Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Possible to change methods in a Class?
Message
From
10/09/1998 11:26:17
 
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00135025
Message ID:
00135082
Views:
11
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform