Thanks for your answer.

so i did it, but for every component i will add, i have to edit the source code from 
the components interface to set a key for the new dependency. it would be nice to be 
independent from the source code and only to edit the block.xml by adding a new 
component using perhaps three components from the second interface. can i get several 
objects from the servicemanager with a lookup when they have the same key? can they 
have the same key?

perhaps my requirements are too high ;)

Regards,
Andr� Steinkamp



-----Urspr�ngliche Nachricht-----
Von: Stephen McConnell [mailto:[EMAIL PROTECTED]
Gesendet: Montag, 23. August 2004 17:40
An: 'Avalon framework users'
Betreff: RE: variable dependencies on Components




> -----Original Message-----
> From: Steinkamp Andre [mailto:[EMAIL PROTECTED]
> Sent: 23 August 2004 17:04
> To: [EMAIL PROTECTED]
> Subject: variable dependencies on Components
> 
> Hi,
> 
> i got a question about the dependencies. i got two interfaces
providing a
> service and more than 2 components for each interface.
> 
> e.g. I1 and I2 are the interfaces, C1 and C2 are components build of
I1
> and C3 and C4 are components build of interface I2.
> 
> my problem is, that C1 wants to use the service of C3 and C4, but C2
only
> wants to use C3. is there a chance to implement this under merlin
3.3.0 ?


Sure .. what you do is to override merlin's automatic assembly logic by
declare an explicit assembly directive.  For example:

  <component name="c2" class="Whatever">
    <dependencies>
      <dependency key="widget" source="c3"/>
    </dependency>
  </component>

See the following link for info about the <dependency directives:
http://avalon.apache.org/products/runtime/reference/containment/componen
ts/dependencies/index.html

Also, there is a tutorial on this subject:
http://avalon.apache.org/central/about/tutorials/basic/dependencies/manu
al.html

Steve.




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to