On Thu, 01 Mar 2007 11:01:05 -0800 merlyn@stonehenge.com (Randal L. Schwartz) 
wrote: 

>>>>>> "Jonathan" == Jonathan Vanasco <[EMAIL PROTECTED]> writes:
Jonathan> On Mar 1, 2007, at 11:30 AM, Ted Zlatanov wrote:

Jonathan> so i've been caching results internally on the object, as such:

RLS> You could use an inside-out object approach.  Create a table
RLS> that is keyed by the RDBO-based object's reference address to contain
RLS> your private cache data.  Just make sure you hook in a DESTROY so that
RLS> your table gets cleaned up.

You can also use Memoize and Memoize::Expire for your functions (since
the object ref $self is just a sub parameter).  Clearing the cache
only for a specific object should be possible but not as easily as
clearing the whole cache.

The advantage is that you don't have to worry about private data and
external tables, and you can do it for any sub.  The disadvantage is
that it's more work upfront, and harder to debug.

Ted

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to