News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

SitePoint PHP Blog:
What's so bad about the Singleton?
February 13, 2008 @ 12:13:00

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.

0 comments voice your opinion now!
singleton designpattern global sideeffect static


blog comments powered by Disqus

Similar Posts

Ralph Schinlder's Blog: PHPundamentals Series: A Background on Statics (Part 1 on Statics)

PHP-Tip-a-Day: PHP Tutorial: The Legend of the Singleton

PHPFreaks.com: Design Patterns - Strategy/Bridge, Value Object, Singleton (Registry)

PHPMaster.com: Understanding the Factory Method Design Pattern

DevShed: Emulating a Basic Web Server with Sockets in PHP


Community Events





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


symfony introduction framework library interview deployment api opinion voicesoftheelephpant laravel list language install release series tips bugfix community podcast package

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