News Feed
Sections

News Archive


Community Events






Don't see your event here?
Let us know!


feed this:

SitePoint PHP Blog:
What's so bad about the Singleton?
6 comments :: posted Wednesday February 13, 2008 @ 12:13:00
voice your opinion now!

On the SitePoint PHP Blog today Troels Knak-Nielsen asks th3e question "what's so bad about the singleton?" For all of its advantages, is there a darker side of the design pattern when it pertains to global variables.

As I have often taken this stance myself, I found it reasonable that I should be able to argue for it, so I'll try to give an explanation. This is also in part a follow-up on my post from last week, in which I present a way to avoid global symbols, without spending much time on why.

He talks about what they are and how they're commonly used - sometimes with some unpleasant side effects because of their use of globals.

tagged with: singleton designpattern global sideeffect static



release application cakephp package framework zendframework releases ajax zend conference example PHP5 PEAR job mysql book database developer code security

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework