|
Posted by FluffyCat on 11/04/05 00:33
....and as promised, an example of the composte pattern in PHP 5.
http://www.fluffycat.com/SDCMSv2/PHP-Design-Patterns-Composite/
Much easier than the memento pattern.
I didn't do a true iterator for the Composite, partly because it
really isn't required for the Composite and partly because I will be
doing one for the Iterator pattern. I like to keep the pattern
examples as pure as I can, and adding an iterator would hav muddied
the waters somewhat.
On Wed, 26 Oct 2005 19:39:41 -0700, FluffyCat <LTruett@FluffyCat.com>
wrote:
>In Febraury - April of 2002 I put together in Java examples of all 23
>of the classic "Gang Of Four" design patterns for my website. Partly
>I wanted to get a better understanding of those patterns. They are
>still online at
>http://www.fluffycat.com/java/patterns.html
>
>Since September 2003 I've mainly been using PHP, and now that PHP 5 is
>becoming more available I am going to try the same thing I did in Java
>with PHP.
>
>I have only completed my pages for Abstract Factory and Factory
>Method thus far and I have a pretty good idea of what I will do for
>Composite and Memento. Hopefully I will be adding one or two new
>patterns each week until all are complete. If any other pattern
>loving PHP enthusiasts want to check it out I'd love your feedback:
>
>http://www.fluffycat.com/SDCMSv2/
Navigation:
[Reply to this message]
|