|
Posted by FluffyCat on 11/01/05 21:33
Hey pattern fans, I just finished my page for the Memento Pattern
using PHP 5. You can check it out at:
http://www.FluffyCat.com/SDCMSv2/PHP-Design-Patterns-Memento/
I found the whole private accessibility issue for the Memento object
was a bit of a struggle. I finally settled on having the memento
called with the originator it was getting or setting, and the memento
would only set or get the originator by calling the originator get and
sets. The downside is that I made the gets and sets on the originator
public, which may not be ideal. The friend class, which is available
in C++ is not availble in PHP, or in Java for that matter. Also not
available is Java's package level accessibility or inner classes. If
I did have to tighten up access on the originator class I might have
looked into either making the memento a child of the originator and
using protected access.
Meanwhile, if there is a nice open source UML tool anyone can
recommend for PHP I'd appreciate it. I'd also be delighted to trade
links and credit on my site for UML class diagrams with a software
company selliing a UML tool for PHP.
-Larry Truett
www.FluffyCat.com
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]
|