[jbosscache-dev] Consistent factory method
Ben Wang
ben.wang at jboss.com
Thu Oct 26 05:12:07 EDT 2006
Manik,
This is a minor issue raised by Brian when he is constructing the bean file for AS5. Currently, we have slight way of creating a cache instance from the factory method.
In Cache, we do:
CacheFactory factory = new DefaultCacheFactory();
CacheSPI tree = (CacheSPI) factory.createCache(c, false);
While in PojoCache, we do:
cache_ = PojoCacheFactory.createInstance(configFile, false);
Nothing wrong with both approaches but maybe we should be consistent in both cache instances. And I don't mind to switch if needed. For me, the reason that I did it in the first place is I don't forsee a pluggable cache instance for PojoCache. And if needed, another Factory can be used as well.
I thought originally with your approach, there is more control over the lifecycle methods. But now it is probably not needed there. Any other reason to stick with your approach?
Thanks,
-Ben
More information about the jbosscache-dev
mailing list