I\'ve tried a few times to understand what a Singleton is. Perhaps I\'m just too visual.. so can anyone break it down in a simple analogy.
Similar Posts:
A singleton is a global variable in sheep's clothing :)
http://googletesting.blogspot.com/2008/08/root-cause-of-singletons.html
Singleton sometimes can be not so single. Take a look here: When a singleton is not a Singleton?, article provided by Sun.
One recommendation: Don't use it. It's just not good, can create serious performance bottlenecks in your application, and the effort to test singleton classes is just not worth it.
From the above mentioned Wikipedia article:
It should be noted that this pattern makes unit testing far more difficult, as it introduces Global state into an application.
Another resource worth looking at is this post on the google testing blog.