I read through many discussions related to Singleton Patterns, and different developers dislike it for different reasons. Not all the reasons make a pattern evil, because many of those reasons doesn’t really make your software really bad. I will be writing here each of the reason, and try to explain whether the reason is justified to call Singleton Evil:
I would enlist here the list of articles which explains why DI is important in designing software today satisfying a few goals like
- Code management
- System learning curve / Ambiguity Management
- API Dependency management
- Application Life Cycle
Interfaces were built to create public API and minimize client code to access fungible objects. I do use interfaces heavily for all the purposes you probably are familiar with. Today I would like to introduce a new and opinionated way I am using interfaces which helps me to create consistent structures of similar classes.