Re: [PHP] Decorator with public methods

2008-12-27 Thread Nathan Nobbe
On Sat, Dec 27, 2008 at 12:35 PM, Larry Garfield wrote: > On Saturday 27 December 2008 2:49:22 am Nathan Nobbe wrote: > > > > Thanks, Nathan. Unfortunately, what you describe is impossible. It > > > requires > > > me to know all the possible decorators ahead of time and implement the > > > inter

Re: [PHP] Decorator with public methods

2008-12-27 Thread Nathan Nobbe
On Sat, Dec 27, 2008 at 12:56 PM, phphelp -- kbk wrote: > On Dec 26, 2008, at 7:53 PM, Larry Garfield wrote: > > I have an object to which I want to add behavior (methods). I cannot use >> inheritance here because the object is already of a type or subtype (vis, >> I am >> already using inherita

Re: [PHP] Decorator with public methods

2008-12-27 Thread phphelp -- kbk
On Dec 26, 2008, at 7:53 PM, Larry Garfield wrote: I have an object to which I want to add behavior (methods). I cannot use inheritance here because the object is already of a type or subtype (vis, I am already using inheritance for something else), and because I want to be able to add mu

Re: [PHP] Decorator with public methods

2008-12-27 Thread Larry Garfield
On Saturday 27 December 2008 2:49:22 am Nathan Nobbe wrote: > > Thanks, Nathan. Unfortunately, what you describe is impossible. It > > requires > > me to know all the possible decorators ahead of time and implement the > > interface for each in each decorator, at which point I've gotten no > > b

Re: [PHP] Decorator with public methods

2008-12-27 Thread Nathan Nobbe
On Sat, Dec 27, 2008 at 12:02 AM, Larry Garfield wrote: > On Friday 26 December 2008 11:06:07 pm Nathan Nobbe wrote: > > > to summarize, using your example above, i would most liely add doThings() > > to Baz, or create another decoration interface for doThings() if you plan > > on using the Bar im

Re: [PHP] Decorator with public methods

2008-12-26 Thread Larry Garfield
On Friday 26 December 2008 11:06:07 pm Nathan Nobbe wrote: > to summarize, using your example above, i would most liely add doThings() > to Baz, or create another decoration interface for doThings() if you plan > on using the Bar implementation of doThings() in many places, > > interface G { > f

Re: [PHP] Decorator with public methods

2008-12-26 Thread Nathan Nobbe
On Fri, Dec 26, 2008 at 6:53 PM, Larry Garfield wrote: > Excuse me a moment while I delve into complex OO. :-) > > I have an object to which I want to add behavior (methods). I cannot use > inheritance here because the object is already of a type or subtype (vis, I > am > already using inheritanc

[PHP] Decorator with public methods

2008-12-26 Thread Larry Garfield
Excuse me a moment while I delve into complex OO. :-) I have an object to which I want to add behavior (methods). I cannot use inheritance here because the object is already of a type or subtype (vis, I am already using inheritance for something else), and because I want to be able to add mult