Overriding object methods (sometimes)
Bradley Dean
bjdean at bjdean.id.au
Tue Feb 26 19:59:20 GMT 2008
Greetings again,
On Mon, Feb 25, 2008 at 05:25:33PM +0000, Bradley Dean wrote:
> I've recently had cause to wrap LWP::UserAgent in a child class
> which needs to override most public methods. In doing so I've hit up
> against a problem - these requests call each other, but I only want my
> child-class methods to be called when I call them.
Thanks for your thoughts - I'm thinking that the composition path is the
one to follow. On reflection what I've written is not really valid
inheritance given that I'd like the class to behave differently when it
calls on itself. Composition solves this problem exactly and much more
neatly.
Cheerio,
Brad
--
Bradley Dean
Software Engineer - http://bjdean.id.au/
Email: bjdean at bjdean.id.au Skype: skype at bjdean.id.au
Mobile(Aus): +61-413014395 Mobile(UK): +44-7846895073
More information about the london.pm
mailing list