DEV Community

Discussion on: AHA! No more STUPID Codes,YAGNI.

Collapse
 
cemkaanguru profile image
cem kaan kosali

After half reading of ...
geekswithblogs.net/AngelEyes/archi...
I am still not sure that singletons are bad.

Collapse
 
mr_cea profile image
Ogbonna Basil • Edited

@cem singletons are not completely bad , they have their use cases. However in most cases you need more than one instance of a class. Also in implementing a singleton class, the single class carries out all the different functions, even those unrelated defiling the SRP in solid.These and many more reasons to consider before choosing to use a singleton.