In PHP 5 there are going to be quite a few new OOP (object-oriented programming) features for everyone to use. Some of these features can be used a bit more wisely than others, and this new article from Zend will show you one way.
In The Template Method Pattern in PHP 5, they show you how to apply the "Template Pattern" (a way of thinking about your code) to an abstract class to help define their functionality. This pattern basicly states that the template method in the abstract class is final (not able to be overwritten), and that the templateMethod is the only function you are "allowed" to call. Most programmers that I know of do this all the time without calling it this. They define an abstract function call in the parent class, then, in the child, redefine it to overwrite the parent's functionality.
I personally use this pattern here on the site for the forms parser and handler scripts. If a handler exists for the form, it runs it. Otherwise, it simply runs a default handler that's defined in the parent to echo out the results.




