[jboss-dev-forums] [Design of JBossCache] - Re: JBoss Cache Options API
manik.surtani@jboss.com
do-not-reply at jboss.com
Fri Jan 30 11:03:43 EST 2009
"david.lloyd at jboss.com" wrote : IDEA has never (iirc) had a problem with varargs. But in any case, if you do decide to go with varargs, it might be a good idea to have a varargs-less variation on the method for the no-options case (if it's common) to prevent the empty-array creation on every method invocation. Though now that I think about it, I don't remember if it makes a significant performance-wise...
Not a "problem" as such, but just suggesting that you needed stuff in there. Reading off method signatures, really - the same thing that makes the javadocs misleading. Goes against the principle of varargs, IMO, since we are talking about an optional parameter, not a variable length one. At least, that is the case the way things are with a single Option object (or an EnumSet of options if options become an enum). Less ugly if we have a vararg of Options, where options are an enum and you provide as many options as you want.
Not so pretty though if you are implementing an external interface, e.g. Map or javax.cache.Cache, but that does take care of the (more common) no-option use case.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4205942#4205942
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4205942
More information about the jboss-dev-forums
mailing list