Giorgio Sironi's Blog: How to eliminate singletons

Courtesy PHPDeveloper.org  Thu, 11/19/2009 - 13:05

Giorgio Sironi has posted a two part look at some techniques you can use to eliminate the singletons scattered through out your code (as sparked by the recent announcement that the Zend Framework project will be doing the same thing).

It is actually very simple to eliminate singletons: just force the components to ask for what they need in the constructor or via setters or via inject*() methods, instead of looking up a singleton trough...


 

More related items

Site News: Popular Posts for the Week of 01.15.2010
Popular posts from PHPDeveloper.org for the past week:Rob Allen's Blog: Zend Framework on a shared host Terry Chay's Blog: Who puts the P in LAMP? Giorgio Sironi's Blog: Practical PHP...

Giorgio Sironi's Blog: Practical PHP Patterns
Starting off a new series on his blog Giorgio Sironi has posted two new tutorials looking at PHP design patterns - specifically the Abstract Factory and Builder patterns. [This series...

Trying a Two Step PEAR/PHAR approach to develop and...
With PHP 5.3 the PHAR extension is a pretty powerful concept for all your deployment needs, however it does not tell the complete story. Frameworks, Libraries and many different of them are...

SanDisk SDMSM2-008G-A11M 8GB M2 Memory Stick Micro...
The Memory Stick Micro (M2) is approximately one-third the size of the existing Memory Stick PRO Duo. The Memory Stick M2 continues the Memory Stick PRO Duo legacy by supporting full...

Linksys WRT610N Simultaneous Dual-N Band Wireless...
The sleek Simultaneous Dual-N Band WRT610N Router sets a new standard for design, expanded bandwidth, and robust performance. It's the ideal router for all your current and future digital...


 

Post new comment

The content of this field is kept private and will not be shown publicly.
computer-internet.marc8.com