Singleton antipattern

Authors: Paul Hammant, Aslak Hellesoy

The singleton pattern was detailed in the GoF "Design Patterns" book. Because of its static nature and public availability, it allows component writers to obscurely reference other components. Overuse makes for bad solutions.

We claim that the GoF Singleton pattern is in fact an antipattern. The downside of the singleton antipattern is that classes depending on it often end up depending on everything and the kitchen sink. Singletons can't be replaced with Mock Objects.

With PicoContainer we would replace this with a container managed single instance, possibly in a container hierarchy (see Five minute introduction).