Reply to The Template Pattern in PHP 5

Your name:

Reply:


Posted by ltruett@fluffycat.com on 08/30/06 15:10

....and I've finally completed my series of GOF design patterns using
PHP 5 with the Template Pattern.

http://www.fluffycat.com/PHP-Design-Patterns/Template/

This is a pretty useful pattern, and one that you could easily use
without even realizing it is a pattern.

Essentially you have an abstract template class that defines a
non-abstract method with an algorithm. Also in the abstract template
class are more methods which said algorithm will use. Some of these
methods are be abstract and must be defined by any concrete extending
classes, while others are not abstract and may be defined by any
concrete extending classes. In the Template pattern, the non abstract
methods should do nothing if not extended.

Pretty simple, basic abstract class stuff. One interesting point here
is that the algorithm in the abstract class controls the main flow of
things, where as ordinarily a method in the extending classes would do
this.

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация