News Feed
Sections




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

Jordi Boggiano's Blog:
Multiton base class
December 30, 2008 @ 11:17:49

In this recent post Jordi Boggiano looks at a different sort of design pattern - a sort of extension of the Singleton pattern: Multition.

While I like the Singleton pattern every now and then, I prefer the flexibility that the Multiton potentially offers, and well it's just an extended version of the Singleton, so it's "compatible" with the Singleton model. Anyway, to the point, PHP5.3 is coming, and with Late Static Binding you can do a base Multiton (or Singleton if you insist), which wasn't possible before. Now I like this very much because you can simply extend it rather than rewriting those (few, I know, but still) lines each time.

Included in the post is an example of the design pattern showing how to create its structure in the class and use it to grab the same or unique instances (defined with an ID).

2 comments voice your opinion now!
multiton base class singleton php5 latestaticbinding lsb


blog comments powered by Disqus

Similar Posts

Greg Beaver's Blog: PhpDocumentor 1.3.0 stable is released

DevShed: Positioning Strings with the show_xy() Method in PDF Documents with PHP 5

Marco Tabini's Blog: 5 PHP 5 features you can't afford to ignore

SecurityReason: Three Advisories for PHP 5.2.4 (dl, iconv_substr & setlocale)

Community News: phpDocumentor-13.0RC6 Released


Community Events





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


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

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