Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Possible to change methods in a Class?
Message
De
10/09/1998 11:26:17
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00135025
Message ID:
00135082
Vues:
10
Hi Mark ---

>Something you might want to consider is the Strategy pattern. With this pattern, you attach a particular strategy object to the target object at runtime, depending on the needs of that object. The target object calls a method of the strrategy object, instead of executing a case statement. The usual example of a strategy object is a sorter, where one of several sorter objects is attached to another object, depending on the type of sort desired.
>

This is very interesting. So you're saying that you create several different classes with the same methods and properties (but the source or values in those PEMs may be different) and then create an instance of the applicable object? That's a doggone good solution when your set of strategies is known.
------------------------------------------------
John Koziol, ex-MVP, ex-MS, ex-FoxTeam. Just call me "X"
"When the going gets weird, the weird turn pro" - Hunter Thompson (Gonzo) RIP 2/19/05
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform