Use your singletons wisely - 0 views
-
I know where you live anti-pattern
-
Liskov Substitution Principle
-
the easier it is to test a class, the more likely a developer will test it.
- ...3 more annotations...
-
"singletons are unnecessarily difficult to test and may make strong assumptions about the applications that will use them [...] I know where you live anti-pattern [...] Liskov Substitution Principle". "To decide whether a class is truly a singleton: * Will every application use this class exactly the same way? (exactly is the key word) * Will every application ever need only one instance of this class? (ever and one are the key words) * Should the clients of this class be unaware of the application they are part of?"