Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Simple class question
Message
De
10/01/1999 20:22:30
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00173492
Message ID:
00174543
Vues:
31
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.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform