[jbosscache-dev] Consistent factory method

Ben Wang ben.wang at jboss.com
Fri Oct 27 10:43:44 EDT 2006


Ic. So what do other people prefer, if we can do it either way?

-----Original Message-----
From: Manik Surtani [mailto:msurtani at redhat.com] 
Sent: Thursday, October 26, 2006 9:17 PM
To: Ben Wang
Cc: jbosscache-dev at lists.jboss.org
Subject: Re: [jbosscache-dev] Consistent factory method

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: msurtani at redhat.com
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