Jim (B),
Just a clarification, if you will. . .
I do not see how the scope resolution operator's need of the parent class' name violates encapsulation. I thought (and still do) that encapsulation would apply to all sub-classes of a parent, all the way up the line to the parent. Is it not also true that the subclass inherently contains the name of its parent (thus 'breaking' encapsulation per the definition you suggest?
Thanks in advance,
Jim N
>>Christof, Jim,
>>
>>Occasionally I use the :: Scope Resolution operator. How does this differ with DoDefault()? Did I miss something here?
>>
>>TIA.
>>
>
>
>Kenneth,
>
>Using the cope resolution operator requires that the parent class's name be hardcoded into the method of the child class. This violates the encapsulation of the code in teh child in that the child must know its parent's name. DoDefault() fire the code of the immediate parent class without refrencing that class by name and is therefore more encapsulated. If, at a future date, you were to use the class browser to change the parent of a particular class the call to the parent's code would still owrk using DoDefault() however it would fail using the scope resolution operator.
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only