References for Why Not to Use Singleton Design Pattern
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
|http://www.youtube.com/watch?v=-FRm3VPhseI Google's Clean Code Talks|
|http://www.phptherightway.com/pages/Design-Patterns.html ("You should be wary when using the singleton pattern, as by its very nature it introduces global state into your application, reducing testability.")|
|http://www.practicaldesignpatternsinphp.com/ ("The Singleton Pattern is perhaps the most well known - and most often misused - pattern in all of PHP design pattern development. Its simplicity, combined with its seeming benefits makes it a widely-used (and overused) pattern. The Singleton is not so much a recommended pattern, as a pattern I recommend you shy away from.")|
|Once you've read all those, read everything abou Dependency Injection, how that helps with injecting mocks during unit testing, and therefore why Singletons are bad.|
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Why aren't these links clickable? Links that are not clickable are like music without a sound, remaining bleak and lifeless, and forever hiding their true purpose.