Blog RSS Feed Subscribe

Jordi Boggiano

Jordi Boggiano Developer, music lover, information junkie, passionate. Possible side effects include starting new projects every second day, trying many beers and losing time on IRC.

Categories

Multiton base class

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.

Continue reading...

December 23, 2008 // PHP // Post a comment