develooper Front page | perl.moose | Postings from February 2009

Re: advice on wrapping methods from a superclass

Thread Previous | Thread Next
Dave Rolsky
February 11, 2009 11:02
Re: advice on wrapping methods from a superclass
Message ID:
On Wed, 11 Feb 2009, Jonathan Swartz wrote:

> The problem is that there are now legitimate reasons to "wrap" these methods 
> at the CHI/ superclass level (meaning, do something before and/or 
> after the method). For example, I want to add an optional generic 
> size-awareness feature (the cache can keep track of its own size), which 
> means that we have to adjust size whenever remove() and clear() are called. 
> And I want to log remove() calls the way we currently log get() and set().
> So one solution is to define remove() and clear() in CHI/, and have 
> them call _remove() and _clear() in the driver subclasses.  But this kind of 
> change makes me uneasy for several reasons:

You want to use augment/inner, I think.



Your guide to all that's veg      House Absolute(ly Pointless)

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About