Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Simple class question
Message
From
10/01/1999 20:22:30
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00173492
Message ID:
00174543
Views:
30
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
Map
View

Click here to load this message in the networking platform