From Design Pattern by GoF
Participants
•
Singleton
defines an
Instanceoperation that lets clients access its unique instanceuniqueinstance.Instanceis a class operation (that is, a class method in Smalltalk and a static member function in C++).may be responsible for creating its own unique instance
uniqueinstance.Collaborations
• Clients access a
Singletoninstanceuniqueinstancesolely throughSingleton'sInstanceoperation.
In Class Singleton, uniqueinstance is the unique instance, and Instance() is its get method.
What are the purposes of the other members:
- method
SingletonOperation(), - method
GetSingletonData(), and - field
singletonData?
Thanks.
