>
>You can't do exactly what you want because you can't change FoxPro's class hierarchy (BTW, there's no such thing :))).
>
>But you can define a Behavior class. This Behavior must have all common methods. Your classes will have a property that will keep a reference to a Behavior object. All methods for this classes will just call the the corresponding methods of Behavior object.
>
>Advantages:
>1. You can have many Behavior classes and change them at runtime. (It's like you would change the class hierarchy at runtime!!);
>2. Behavior classes can have also a property that will point to another behavior object. This is extremly good because you can chain Behaviors.
>
>Disadvantage: You can not do the same thing for properties since there is no possibility to call (automatically) a method everytime a property is used (like you can do in Visual C++). And this is a VERY BIG lack of VFP.
>
>Vlad
A note on the Disadvantage..you can accomplish this by using a method to set your properties (eg. Set_Property(cPropertyName, vNewValue)). Within this method you could do whatever you want depending on the property set. Of course you need to remember to *always* use this method when setting properties...
-Doug-
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement