Dependency Directive

Description

A dependency directive is used to override merlin's auto-assembly semantics by declaring a relative path to a component that should be used as the service provider.

Attributes

Attribute Required Description
key yes The dependency key.
source yes The relative path to the component to use as the service provider.

Sample XML

<container name="tutorial">

     <classloader>
       <classpath>
         <repository>
           <resource id="avalon-framework:avalon-framework-impl" version="4.1.5"/>
         </repository>
       </classpath>
     </classloader>

     <component name="gloria" class="tutorial.IdentifiableComponent"/>
     <component name="nancy" class="tutorial.IdentifiableComponent"/>

     <component name="hello" class="tutorial.HelloComponent">
       <dependencies>
         <dependency key="primary" source="gloria"/>
         <dependency key="secondary" source="nancy"/>
       </dependencies>
     </component>

</container>