Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Singleton Pattern
Message
From
16/12/2002 10:18:53
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Title:
Singleton Pattern
Miscellaneous
Thread ID:
00733289
Message ID:
00733289
Views:
57
How I can do a Singleton Pattern Class in VFP?

I need a Object create one and only one time.

I know if I return .F. in the Init Event the object isn´t create.

But, what I needed is return a reference the object is created already.

Something like that:
oFirstObject = CREATEOBJECT("MySingletonClass")

oSeconObject = CREATEOBJECT("MySingletonClass")
The second CREATEOBJECT("MySingletonClass") don´t create a new object, it return a reference to oFirstObject.


Thanks in advance.
José Luis.

Quidquid latine dictum sit, altum sonatur

Next
Reply
Map
View

Click here to load this message in the networking platform