[PHP-DEV] Re: [fw-webservices] Re: [PHP-DEV] RFC - class underloading -or- ancestor overloading

2010-03-15 Thread Hector Virgen
I also ran into this problem with Zend_Db_Select. I wanted to add a new constant to improve my usage of Zend_Db_Table#select(), but that method would always returns an instance of Zend_Db_Table_Select which extended Zend_Db_Select. There was no easy way for me to add my class constant without

Re: [PHP-DEV] Re: [fw-webservices] Re: [PHP-DEV] RFC - class underloading -or- ancestor overloading

2010-03-15 Thread Larry Garfield
The challenge of never use extend is that simply wrapping classes in decorators only goes so far. You can't always maintain interface compliance if you're nesting decorators, and if you're overriding only one out of a dozen or two methods then you have a lot of foo() { return $obj-foo(); }

Re: [PHP-DEV] Re: [fw-webservices] Re: [PHP-DEV] RFC - class underloading -or- ancestor overloading

2010-03-15 Thread Nate Gordon
On Mon, Mar 15, 2010 at 2:14 PM, Larry Garfield la...@garfieldtech.comwrote: The challenge of never use extend is that simply wrapping classes in decorators only goes so far. You can't always maintain interface compliance if you're nesting decorators, and if you're overriding only one out of

Re: [PHP-DEV] Re: [fw-webservices] Re: [PHP-DEV] RFC - class underloading -or- ancestor overloading

2010-03-15 Thread Larry Garfield
On Monday 15 March 2010 03:08:28 pm Nate Gordon wrote: If there were a syntactic-level support for wrap this object in this class and pass through any method that isn't redefined, a sort of sideways extends, that would become much simpler. I'm not sure what that would look like,

Re: [PHP-DEV] Re: [fw-webservices] Re: [PHP-DEV] RFC - class underloading -or- ancestor overloading

2010-03-15 Thread Richard Quadling
On 15 March 2010 21:43, Larry Garfield la...@garfieldtech.com wrote: On Monday 15 March 2010 03:08:28 pm Nate Gordon wrote: If there were a syntactic-level support for wrap this object in this class and pass through any method that isn't redefined, a sort of sideways extends, that would

[PHP-DEV] Re: [fw-webservices] Re: [PHP-DEV] RFC - class underloading -or- ancestor overloading

2010-03-13 Thread Abraham Block
This is a good use of the decorator pattern. Let's say you don't like the way Zend_Form_Element filters form names. You can decorate it with a Your own class which overrides this, and whenever you add a new element to your form, decorate it with this class. On Sat, Mar 13, 2010 at 10:10 AM,