Original Post
What is the true purpose of a singleton?
I keep reading that using them as a replacement for global variables is bad. Ok, so that eliminates one possible use. What's left?
Simplistically, a singleton is just a class that allows only one instance, but what are we really trying to accomplish by using them? I can create one object of a class and then simply refrain from creating more. Does that accomplish the same thing?
Are we trying to prevent people from accidentally creating more, or from purposefully circumventing the one instance limit?
Additionally: Should a singleton methodology be eaily applied to existing classes or should a class be designed to be a singleton from the ground up? (I ask because I have seen singleton templates and base classes...)
What do you think?