You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@avalon.apache.org by "Day, Jem BGI WAC" <Je...@barclaysglobal.com> on 2002/02/05 18:36:10 UTC

Cache : Addtional Functionality

All,

  Before I embark on any changes I thought I'd float my thoughts past you
  all.

  I'm contemplating adding some sort of 'CacheMissListener' functionality,
  the role of such a component would be to be advised of 'misses' and thus
  be given the opportunity to add the elusive missing Object.

  Thus the questions..

  1. Are you even interested in this :-)
  2. Would you see this a an addition to the existing 'CacheEventListener'
or
     a new interface. Personally i lean toward a new interface/listener.

  The rationale behind this is that I've lost count of the number of times
I/we
  have written caches to front information stored in a Database, we
inevitably
  end up writing code like...

     Object o = get from cache

     if (o == null) {
         o = attempt get data from database

         if (o == null) {
            bummer - it's really missing
         }
         else {
            put o in the cache
         }
      }

  Thoughts/Opinions welcome...

Jem..




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>