Last time, I argued in favor of the Singleton pattern in WordPress. Singletons make sense in WordPress specifically for several reasons: They live in the global scope without using the already abused/overused global keyword As a distributed application maintained by several hundred developers, they prevent problems that likely arise from others misusing your code But […]
The Case for Singletons in WordPress
Please also review my follow-up post, Making Singletons Safe in PHP. There has been a lot of discussion this week regarding the Singleton pattern and whether or not it has a place in modern software development. Mike Schinkel wrote a tutorial about a Singleton factory. I wrote one about using Singletons as a WordPress plugin […]