4 ms·
>". If it's a regular factory/object and you only ever use a single instance, chances are nothing will care" That's true, although if it is a single instance b
by pmelendez 13y ago
>". If it's a regular factory/object and you only ever use a single instance, chances are nothing will care"
That's true, although if it is a single instance but not global then you are not enjoying the benefits of the guaranteed of an unique instance.
A well used singleton is a great tool that simplify things a lot.
- masklinn 13y ago> A well used singleton Something which I've come to believe does not exist, the pattern itself is broken. Thus, > singleton is a great tool no. > that simplify things a lot. Paraphrasing Mencken, for every complex problem there is an answer that is clear, simple, and wrong. Singleton is ever that answer.
- pmelendez 13y ago>Something which I've come to believe does not exist, the pattern itself is broken. >Paraphrasing Mencken, for every complex problem there is an answer that is clear, simple, and wrong. Singleton is ever that answer. Just because you haven't found a good use it doesn't mean it doesn't exist. And about Mencken... All he said is that you can't have Singletons without having a Global State (obvious) and apparently he has an strong allergy to global states. Global states are fine. Sure, they will make your tests harder but there are a lot of software that don't use unit test for legitimate reasons and hence don't have that problem.