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

phpPatterns:
Decorator Pattern Redecorated
Dec 18, 2003 @ 13:23:23

On phpPatterns.com this morning, there's a visit back to an old favorite when it comes to patterns - the Decorator pattern. (If you need a refresher, see this article.) But, this time, he thinks he has it right...

Back in January of 2003, made a first attempt at explaining the Decorator pattern and have often felt since that I failed to do it justice, taking an overly literal implementation from the GoF Design Patterns which was poorly suited to PHP (that said, I'll assume here you've read that discussion and build on it).

The article goes on to talk about how the pattern works, creating children objects of the same instance instead of using a "child class". Later in the piece, he talks more about some of the additional features you could use with this pattern, including: PEAR:Calendar, WACT Record Sets, and HTMLSax.

tagged:

Link:


Trending Topics: