-----Mensagem original----- De: Carsten Ziegeler [mailto:[EMAIL PROTECTED]
> Hmm, no, I don't think so - but perhaps I'm really wrong. Imagine > that you your implementation needs in some cases no service XY, > in some cases one instance of it and in some rare cases two instances. Hey, but... hey! wait. Components should help the container to understand what it needs to work properly. If I give a puzzle to container, I must fulfil the needs by other means. That the approach of Pico. http://cvs.picocontainer.codehaus.org/java/picocontainer/src/java/org/picoco ntainer/defaults/ComponentParameter.java?rev=1.18&view=auto /** * A ComponentParameter should be used to pass in a particular component * as argument to a different component's constructor. This is particularly * useful in cases where several components of the same type have been registered, * but with a different key. Passing a ComponentParameter as a parameter * when registering a component will give PicoContainer a hint about what * other component to use in the constructor. * * @author Jon Tirsén * @author Aslak Hellesøy * @version $Revision: 1.18 $ */ public class ComponentParameter implements Parameter, Serializable { ... > If you are setter based, you only have one setXY() method, if you > use a constructor you could have two arguments for the services > there and then only use the amount of services you want, yes. > But that looks a little bit ugly to me :) Agreed. > Of course the best examples come from Cocoon :) We build pipelines > on a per request base, based on the called uri, the environment etc. > Now, we have approx. 200 different pipeline components. Per request > only approx 5 are assembled to build the pipeline. > With a dynamic lookup mechanism you simply lookup the 5 components > you need per request and combine them. > And I think these scenarios are perfect areas for Avalon. Agreed as well. But let's not restrict ourselves by Avalon ;-) Cheers, hammett --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Apache Excalibur Project -- URL: http://excalibur.apache.org/
