----- Original Message ----- From: "Peter Royal" <[EMAIL PROTECTED]> To: "Avalon framework users" <[EMAIL PROTECTED]> Sent: Tuesday, October 22, 2002 4:40 PM Subject: Re: Multiple instances with different parameters
> You have a group of components, lets call them Group A. Each one of > them requires a component of type B to do its job. Each component in > Group A will require its own component of type B, > configured(parameterized) for its specific needs. Yes? > > I would recommend using the ComponentSelector. Type B is really a Role, > and you have multiple components that fulfill that role (even if its > the same java class, they are configured differently). > > Components in Group A would then do a lookup() which will return a > ComponentSelector interface. From that interface you will then be able > to select which specific 'Type B' component you wish to use. I've taken a look at selectors you mentioned above, and seen that they pose certain restrains comparing to usage of ordinary classes in non-avalon apps. When one wants to use instances of same class in various places in non-avalon app, configured for specific needs, each instance can be configured differently by usage of constructor argument. In case this argument is only known during RUNTIME, it's impossible to realize this in avalon apps using selectors, because I have to configure these different 'instances' (with their parameters) in system.xconf file during DESIGN TIME when parameter is still unknown. Of course, I can create method in working interface (role) for setting this parameter, but that's not what role is intended for. Some idea ? -Vjeran -- To unsubscribe, e-mail: <mailto:avalon-users-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:avalon-users-help@;jakarta.apache.org>