DEV Community

Discussion on: Why Singletons Are Bad?

Collapse
 
amrtaher1234 profile image
Amr Mohamed

I totally agree with you, they could be perfect in such use cases but I generally would not recommend the using of such pattern. It just doesn't feel right to have something globally swimming in your codebase and you'd have to design it carefully to take care of your unit tests and to disallow other functions or classes to manipulate it without being authorized to.