According to the Single responsibility principle:
Every class should have responsibility over a single part of the functionality provided by the software
A singleton prevents the creation of multiple instances of a class, providing a global access to it.
But this functionality is not related in any way to the actual functionality of the class and what it should provide.
Does this mean that the Singleton pattern violates the SRP ?
Aucun commentaire:
Enregistrer un commentaire