Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Singleton Class
Message
From
10/11/2005 11:46:11
 
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Miscellaneous
Thread ID:
01064942
Message ID:
01067220
Views:
20
>I'm sorry I meant to say PEMStatus() that will let you know if the method has been overridden. As far as the code goes though there is only so much you can do that would control the possible subclassing. What you really have to do is code a robust baseclass which probably won't be completely finished until the fourth or fifth subclass has been created to really put the class through its paces.

Yes PEMStatus() is the one. I implemented something with it, and then noticed that it was not necessary, as the check on the calling stack was enough : if somebody overrides the Init without calling DODEFAULT() there is not much I can do anyway, and if somebody does it with calling DODEFAULT(), I can tell from the stack that Singleton.Init was not called by GetSingleton(). Job done :-)

>The mutex code is one manner in which you can create a singleton detection code. My singleton class uses a DDE based detection method.

Unfortunately, for the moment my time for Singleton is over and I must move to other things. We will live with private vars, and I will come back to this if necessary. Good to know that it is possible though !

Thanks for everything,

David
Previous
Reply
Map
View

Click here to load this message in the networking platform