[infinispan-dev] factorizing some code in CacheDelegate

Mircea Markus mircea.markus at jboss.com
Fri Mar 26 10:47:36 EDT 2010


Hi,

All the methods that support eviction(maxIdle) and expiration(timeToLive) have 3 versions. E.g.
put(k,v, maxIdle, timeToLive);
put(k,v, maxIdle);
put(k,v);

version 2 and 3 delegate to version 1, using default values.

This logic can be re-used in RemoteCache. I'm thinking to create an abstract class (CacheSupport implements Cache) that would take care of all these delegations and will be extended by both CacheDelegate and RemoteCacheImple. 
Advantage: code re-use and nicer-looking (sexier as one would say) CacheDelegate and RemoteCacheImpl.
No API changes needed.

Wdyt?

Cheers,
Mircea
 



More information about the infinispan-dev mailing list