www.migniot.com

Coding rules

Rule #2 Singletons are evil

I mean it - singletons are evil.

My two cents : a global variable is better than a singleton. If you need one, at least admit it is a global variable. Let's take an example with the Singleton World, serving the maps of the Earth through getMapFor(String:Country):Map . One day you will need the map from mars. With a global variable your code would be refactorable whereas a Singleton will lead to unrefactorable code.

You never need a singleton. You can always replace it by a root injection.