-
1. Re: SingletonStoreCacheLoader in 2.0
vblagojevic Sep 20, 2006 5:05 PM (in response to galder.zamarreno)Whoever wrote CacheLoaderInterceptor.isCustomCacheLoaderConfigured() is a very creative person ! IMO you have to come up with more good reasons why you would do what you propose other than improving already a nicely written method:) Are you almost done SingletonStoreCacheLoader?
Why not create AbstractDelegatingCacheloader class that combines things that are common to all future delegating cacheloaders. One of them is getCacheLoader method but I would implement all cacheloader methods in AbstractDelegatingCacheloader with delegates. Subclasses then just have to override specific methods. For example, I am looking at AsyncCacheLoader and it needs to override only half a dozen methods.
What do you think? -
2. Re: SingletonStoreCacheLoader in 2.0
galder.zamarreno Sep 20, 2006 5:31 PM (in response to galder.zamarreno)Chill mate! :-), I just realised this on a flight back to Switzerland and I still
haven't had the chance to sit down and look at the ramifications and
extra possible benefits. This thread was intended to pitch the idea and get
some feedback.
The original thought, and therefore the main reason, was that both cache
loaders share the same aspect which is, delegating the work on another
cache loader as I already pointed out.
The second point, and the one I found after realising the first one,
regarding isCustomCacheLoaderConfigured() was just an example of the
benefits. I haven't looked at this method in detail yet.
I will indeed look at the exact similarities between the two and see which
aspects can be abstracted to this upper layer.
Thanks -
3. Re: SingletonStoreCacheLoader in 2.0
manik Sep 21, 2006 6:47 AM (in response to galder.zamarreno)"vblagojevic@jboss.com" wrote:
Whoever wrote CacheLoaderInterceptor.isCustomCacheLoaderConfigured() is a very creative person !
If you were being serious, I'll take credit for it - if you were being sarcastic, I have no idea who wrote that! :-)"vblagojevic@jboss.com" wrote:
Why not create AbstractDelegatingCacheloader class that combines things that are common to all future delegating cacheloaders. One of them is getCacheLoader method but I would implement all cacheloader methods in AbstractDelegatingCacheloader with delegates. Subclasses then just have to override specific methods. For example, I am looking at AsyncCacheLoader and it needs to override only half a dozen methods.
I think this is a good idea, since the majority of cases the call is just passed to the underlying loader. If someone just extends the AbstractDCL he'd end up with the same basic features of the underlying cache loader, and any added behaviour will have to be introduced by overriding methods. It would have to be javadoc'd pretty clearly to that effect. -
4. Re: SingletonStoreCacheLoader in 2.0
vblagojevic Sep 21, 2006 9:52 AM (in response to galder.zamarreno)If you were being serious, I'll take credit for it - if you were being sarcastic, I have no idea who wrote that! :-)
No sarcasam tags around it! Cheers.