[jboss-dev-forums] [Design the new POJO MicroContainer] - Re: AbstractCollectionMetaData fails with optional add() ope

adrian@jboss.org do-not-reply at jboss.com
Wed Jul 4 09:10:57 EDT 2007


Yes, but the whole point of pre-instantiated is to reduce the amount users have
to write in xml - not least because it can also become inconsistent if they have
to do it two places.

Imagine if Juha's class was:


  | public class PluginManager
  | {
  |   private List bootstrapPlugins = new CopyOnWriteArrayList(10);
  | 
  |   public void setBootstrapPlugins(List listOfPluginNames)
  |   {
  |     this.bootstrapPlugins = listOfPluginNames;
  |   }
  | 
  |   public List getBootstrapPlugins()
  |   {
  |     return bootstrapPlugins;
  |   }
  | }
  | 

The user doesn't want to have to say "preinstantiated=true" or
class="java.util.concurrent.CopyOnWriteArrayList" to make this work
how they would expect!

It should just work out of the box.

It's only in classes like Juha's where you have to turn off preinstantiated
because the getter is returning an immutable.
Therefore you need to be explicit about what implementation you really want,
we can't work it out.

We should optimize for the common cases.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4060455#4060455

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4060455



More information about the jboss-dev-forums mailing list