Friday, January 19, 2007

The singleton universe!

Singleton pattern appears to be very easy to understand because in its simplest form it can be implemented in minutes with the help of well defined language idioms. But in fact, it is one of the most complex patterns I have ever read about! If you dig around a little bit, there is a whole slew of information/articles available on this nifty pattern talking about its limitations and their solutions. Here is a collection of some of the amazing articles.

The Singleton pattern - Gamma et al.
To kill a Singleton - John Vlissides
The Monostate pattern (The Power of One (More C++ Gems) - Steve Ball and John Crawford)
Implementing Singletons (Chapter 6, Modern C++ Design) - Andrei Alexandrescu
Double Checked Locking Pattern (DCLP) - Doug Schmidt
C++ and the perils of DCLP - Scott Meyers, Andrei Alexandrescu
DCLP is broken in Java - Bacon et al.
Object Lifetime Manager pattern - Levine, Gill, and Doug Schmidt


Ivan Novick said...

nice, thanks for that list of good articles

Neo said...

Yo may also find usefull information about Singleton at