General information
Category:
Object Oriented Programming
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
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only