News Feed
Jobs Feed
Sections




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

DevShed:
Introducing the Memento Pattern
January 08, 2007 @ 15:48:00

Diving even further into the world of design patterns, DevShed has posted this new tutorial looking at the Memento pattern - useful for (in their example) carrying objects from page to page.

Don't you worry about it for the moment, because in this two-part series, I'm going to demonstrate with numerous code samples how to apply the memento pattern so that it can be used within your own PHP applications with only minor problems.

They start with the simplest example of the pattern, working with arrays - get, set, etc. On top of that, they build a "caretaker" class that

will be the one holding the state of the object from the other class. Finally, they tie them both together to create a simple model of a caretaker that stores and remembers how the object inside is formatted.
1 comment voice your opinion now!
design pattern memento tutorial array caretaker design pattern memento tutorial array caretaker


blog comments powered by Disqus

Similar Posts

HowToForge: How To Install a Complete LEMP on Ubuntu/Debian

Tibo Beijen's Blog: Zend_Form: Building dynamic forms

SitePoint PHP Blog: Getting Started with PHP Extension Development via Zephir

DevShed: Controlling Online Forms with Builder Objects in PHP 5 (Part 2)

NETTUTS.com: Can You Hack Your Own Site? A Look at Some Essential Security Considerations


Community Events











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


language install series hack release symfony2 component hhvm facebook composer introduction overview framework package application code security opinion podcast unittest

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