View Single Post
Old 06-05-2008, 08:29 PM   #8 (permalink)
delayedinsanity
is cute and cuddly
 
delayedinsanity's Avatar
 
Join Date: Mar 2008
Location: Vegas, Baby
Posts: 963
Thanks: 31
delayedinsanity is on a distinguished road
Default

Kind of a chained singleton. You still don't need to extend anything at this point though, since you'll be able to call clean a la

PHP Code:
$pUmbrella = new p101();
$pUmbrella->clean->clean_var($szString); 
You may want to consider if you need to include and instantiate EVERY object on every page, every time. It seems like I'm doing this a lot lately, I feel kind of like a registryvangelist, but check this noise out: Registry pattern and definitely The Singleton Design Pattern for PHP <-- the singleton and registry are two of the easiest OOP design patterns to implement, but that's not to say they lack any power, as you'll find scripts all the way up to the Zend Framework using them.

If you want a great book on PHP object orientation and design patterns, take a peek at:
APRESS.COM : PHP Objects, Patterns, and Practice, Second Edition : 9781590599099

That book and Pro PHP are snazzy.
-m
delayedinsanity is offline  
Reply With Quote
The Following User Says Thank You to delayedinsanity For This Useful Post:
SpYkE112 (06-06-2008)