Hi Rod

From: "Waldhoff, Rodney" <[EMAIL PROTECTED]>
> > (ii) the values of the expiry and cost arguments
> > come from the cache themselves rather than the
> > application programmer. Defaults could be applied
> > to a particular cache (region) via a config file
> > or whatever. Often an application developer doesn't
> > know what these values are
>
> I have no issues with defaults, but I would argue that it should be the
> application program who defines these values.  (I think you're saying the
> same thing, we'd just need a default for the Map-ish case.)

I think we're agreeing too. If the application programmer doesn't know or
want to know what the values of cost & expiry should be (or knows where they
should come from in a config file / JNDI sense) then let the cache uses its
defaults which can come from a deployment configuration.

I'm a great believer in deployment configurations and prefer to take as much
deployment information out of compiled code and into some configuration
mechansim as possible. So I guess I'm saying is I'd like to make these
default cost & expiry values properties on the implementation classes that
can be configured using some mechansim, whether its digester, a custom
config file, a bean builder, JNDI or whatever.

> > Similarly I'd like the remove() method to return the
> > previous value that was in the cache or null if there is
> > nothing cached for the key, to be similar to the
> > Map.remove(key) method.
>
> Retrieving an object from the cache may be significantly more expensive
than
> just removing it or checking if it exists.  I'm OK with this as long as
> there is a plain remove-and-don't-retrieve method as well, maybe Object
> remove(Object key, boolean retrieve), which always returns null if
retrieve
> is false?

Agreed. If there was no value in the cache for the given key then it should
return null.

> Feel free to dig in and make changes.  If I didn't think this needed a
fair
> amount of work, I would have proposed it for commons proper already.

Cool, thanks.

James



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Reply via email to