RE: variable dependencies on Components

"Stephen McConnell" <[email protected]>
Newsgroups gmane.comp.jakarta.avalon.user
Message-ID <004601c48927$679340d0$1601a8c0@gloria>

> -----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.
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.