V
Venkat Sadasivam
Singleton is one of the frequently used and easily understandable
design pattern. Most of the tutorials and books give example of making
the constructor as private and exposing a static method which will
provide single instance. The common example they use is Runtime class
of JRE.
Is making constructor as private is the only way to implement
singleton pattern? Is that the best way to implement singleton
pattern?
Here is the complete article.
http://venkatsadasivam.wordpress.co...tter-approach-to-implement-singleton-pattern/
- Venkat
design pattern. Most of the tutorials and books give example of making
the constructor as private and exposing a static method which will
provide single instance. The common example they use is Runtime class
of JRE.
Is making constructor as private is the only way to implement
singleton pattern? Is that the best way to implement singleton
pattern?
Here is the complete article.
http://venkatsadasivam.wordpress.co...tter-approach-to-implement-singleton-pattern/
- Venkat