Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Singleton Pattern
Message
From
16/12/2002 10:54:13
 
 
To
16/12/2002 10:18:53
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00733289
Message ID:
00733293
Views:
25
Hi José.

>How I can do a Singleton Pattern Class in VFP?

One of the ways you can do this is to use a Class Factory instead of instantiating the class directly. With a class factory, you ask one class to create objects of other classes for you. Beside the run-time flexibility this provides (you can change the class being instantiated more easily), this can support singleton classes: the class factory object checks to see if it has already created a singleton object (it obviously will have to maintain a reference to the singleton object) and if so, return the reference to that object rather than creating a new one.

Doug
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform