AW: variable dependencies on Components

"Steinkamp Andre" <[email protected]>
Newsgroups gmane.comp.jakarta.avalon.user
Message-ID <70D96E20708058488B73E2F0CDD63524095282@ssn-ex2000>
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]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.