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:
Using the Memento Pattern with a File Reading Class
January 15, 2007 @ 14:22:00

DevShed continues their look at design patterns in PHP with this last installment of their Memento pattern series - "Using the Memento Pattern with a File Reading Class".

Let me now introduce the topics that I'll be covering in this last article of the series. I'll show you how to use the memento pattern to keep track of some properties that correspond to a file reading class. In this way we'll construct a flexible mechanism for moving back and forth between file lines.

They create both of the needed classes for the pattern to work - the originator and the caretaker class - to handle the reading of the files. The code for both is pretty cut and paste-able, so there's no problem getting your example to work. With those constructed, they tie them together with an example of the design pattern in action - reading and displaying the lines of a text file to the user.

0 comments voice your opinion now!
memento design pattern tutorial read file echo class memento design pattern tutorial read file echo class


blog comments powered by Disqus

Similar Posts

NetTuts.com: Sending Emails With Laravel 4 & Gmail

Norbert Mocsnik's Blog: Setting Up DokuWiki with Simple Authentication

Dagfinn Reiersol's Blog: Real programming with PHP 5.3 (part 2): JavaScript-style classes

The Bakery: New Tutorials - PHPTAL, Multiple Checkboxes, and counterCache

Jeez Tech: Using APIs With PHP? Here Are Your Classes


Community Events











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


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

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