Posted on January 15, 2014
- The Clean Code Talks – “Global State and Singletons”
- Why Singletons have no use in PHP
- Testing Code That Uses Singletons
- Making Singletons Safe in PHP
- The “Missing” Patterns of the PHP Manual — Singleton
- Why Singletons are Evil
- Design Patterns “You should be wary when using the singleton pattern, as by its very nature it introduces global state into your application, reducing testability.”
- “Practical Design Patterns in PHP” book “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.”
- “Singletons in PHP – Why they are bad and how you can eliminate them from your applications” presentation
- Singleton pattern – Wikipedia
- “Do I Need a Singleton” illustration
I have some reading to do!
After referencing this article a few times, I have accumulated more great resources.
More reading on Singletons:
More reading on Dependency Injection (DI):