News Feed
Sections




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

DevShed:
Introducing Visitor Objects in PHP 5
August 02, 2006 @ 09:51:19

Hot on the heels of their previous patterns-related series, DevShed has posted this new tutorial with a look at the Visitor pattern, specifically as applied to objects.

You'll agree with me that one of the most interesting aspects of design patterns is precisely their practical side. Therefore, considering this undeniable fact, in conjunction with your permanent wish for extending your background in object-oriented programming with PHP, over the course of this series I'll be showing you some useful examples of how to build visitor objects, and more specifically how to include them in real-world applications.

They start with an example, complete with code, of a simple addElement call to store data in an array. The next logical step for storage is to an external resource, so they modify things slightly to write the data out to a file. Finally, they define the other side of things - the actual object that does the "visiting" to the previously defined classes.

0 comments voice your opinion now!
visitor pattern object tutorial introduction visitor pattern object tutorial introduction


blog comments powered by Disqus

Similar Posts

Gonzalo Ayuso's Blog: Inject dependencies via PhpDoc

Cory Borrow's Blog: Creating thumbs from textfiles with PHP and GD

Stefan Mischook's Blog: Cannot load mysql extension error - Video Tutorial How To

NetTuts.com: Building a CodeIgniter Web Application From Scratch - Part 1

Master Zend Framework: Easy Cache Configuration With StorageCacheAbstractServiceFactory


Community Events

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


php7 introduction unittest version voicesoftheelephpant interview language example laravel series api community opinion framework release library extension install podcast laravel5

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