[jbosscache-dev] Consistent factory method

Manik Surtani manik at jboss.org
Thu Oct 26 09:24:46 EDT 2006


Nothing more than the factory is a simple class.  If user code wants  
to wrap it in a singleton and create factory methods in the wrapper,  
it is up to them.  Just keeping things simple.

--
Manik Surtani

Lead, JBoss Cache
JBoss, a division of Red Hat

Email: manik at jboss.org
Telephone: +44 7786 702 706
MSN: manik at surtani.org
Yahoo/AIM/Skype: maniksurtani


On 26 Oct 2006, at 10:12, Ben Wang wrote:

> 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
>
> _______________________________________________
> jbosscache-dev mailing list
> jbosscache-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/jbosscache-dev




More information about the jbosscache-dev mailing list