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

Matthew Weier O'Phinney's Blog: Using the ZF2...
Matthew Weier O'Phinney, lead on the Zend Framework project, has a new post to his blog talking about the event manager in the Zend Framework, v2 and how to use it in a refectored version of...

Padraic Brady's Blog: Zend Framework Community Review...
In order to help relieve some of the flood of issues that the Zend Framework project has with contributions, a new team has been/is being formed to work with some of the issues surrounding...

Cal Evans' Blog: Zend's new namespace converter
Cal Evans has a new post today looking at a recent release coming out of the Zend Framework project - a namespace converter to take the standardized naming schemes and convert them into PHP...


 

Post new comment

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