DEV Community

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

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.