Caching a singleton so it expires

First time thinking about integrating cache options…and of course I don’t pick anything easy to do…or do I?

So, reading about this wonderful feature makes me thing this:

I have a collection object that houses a set of objects derived from some data. Typically they are not going to change often, but they will change. Generally I want to persist the collection object as a singleton. If the app get’s reinitialized, the collection is reset. But what I’d like to do is have the collection object be smart enough to do (or react to) two things.

  1. Every 30 minutes (or whatever timeframe I want) the collection will reset itself (thus re-fetching the data it needs and re-positioning it as a persisted object)
  2. If an administrator changes the data that this collection object houses, when the data is changed, the object is TOLD to reset itself.
    Is this possible or am I of the right thinking that this is one of the many advantages of being able to apply cache features to an object?

Thanks,

Mike Craig

Mike. Curt Gratz just posted an aop aspect that does something very similar to forgebox called cache back

Check it out

Luis Majano
CEO
Ortus Solutions, Corp
Toll Free/Fax: 1-888-557-8057
Direct: 909-248-3408
www.ortussolutions.com
Twitter: @lmajano, @ortussolutions