Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Superclass
Message
De
23/05/1997 09:13:42
 
 
À
22/05/1997 18:56:35
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00033281
Message ID:
00033400
Vues:
39
>
>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
Fil
Voir

Click here to load this message in the networking platform