commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Emmanuel Bourg <e.bo...@cross-systems.com>
Subject [cache] Turning cache into a thin abstraction layer a la logging ?
Date Tue, 02 Dec 2003 14:24:29 GMT
It seems the cache component in the sandbox is no longer developed, 
however I'm convinced there is a need for a common caching API, at least 
until the JSR 107 is completed. I think the cache component could be 
turned into a thin layer similar to commons logging, abstracting the 
various implementations already available (JCS, OSCache, SwarmCache...).

The JCache project uses this approach (http://jcache.sourceforge.net), 
it tries to implement the first published specifications of the JSR 107, 
but it seems the final specification will be completely different and 
Map based.

For the API I was thinking at :
- a Cache interface extending the java.util.Map interface and adding a 
CacheException on the put, get, remove and clear methods.
- the CacheException would be a runtime exception so that a cache can be 
used as a Map without additional try catch blocks
- an abstract CacheFactory with a static getCache(String region) method 
(and maybe a similar getCache(Class cls) method)
- Cache and Factory implementations for some open source caches (at 
least JCS)
- a simple cache implementation, wrapping the LRUMap from commons 
collections for example
- the component will not be responsible for the configuration of the cache

I'm willing to contribute if it is seen as a step in the right direction.

Emmanuel Bourg


Mime
View raw message