G
Gerry O'Brien [MVP]
See below...
--
Gerry O'Brien
Visual Basic .NET MVP
What kind of a name would you suggest? You don't HAVE to use the name
of the field but it is more intuitive. It makes no difference what you call
it as other developers may or may not understand it anyway. It is then up
to you as the original developer of the class to ensure that you have
properly commented your code so that the descriptions show up in the Object
Browser.
Seriously wrong here. Every book on OOP will tell you exactly what Bob
has stated here.
it. In other words, how the value is assigned within the class. What
purpose would it serve to hide the data type? What you are saying then is
that you would declare a field to be of type integer and then declare a
property for that field to accept a string value. Then in your property set
procedure you would convert the string to an integer?? That makes no sense.
--
Gerry O'Brien
Visual Basic .NET MVP
MN said:In that case, you should declare a method with an explicit name (not a
name of a field) which take the value and perform the changes that will be
operated on the class and other classes;
that will be clear for the creator of the class and other developpers that
will use it.
What kind of a name would you suggest? You don't HAVE to use the name
of the field but it is more intuitive. It makes no difference what you call
it as other developers may or may not understand it anyway. It is then up
to you as the original developer of the class to ensure that you have
properly commented your code so that the descriptions show up in the Object
Browser.
It's a bad technique;
Seriously wrong here. Every book on OOP will tell you exactly what Bob
has stated here.
No it does not. Encapsulation means to hide to implementation ofEncapsulating data means also that no one should know what's the type of
your field; I don't think that's what is used with properties.
it. In other words, how the value is assigned within the class. What
purpose would it serve to hide the data type? What you are saying then is
that you would declare a field to be of type integer and then declare a
property for that field to accept a string value. Then in your property set
procedure you would convert the string to an integer?? That makes no sense.
