Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
borderColor#6699ff
bgColor#ffffff
titleBGColor#D5EFFF
titleComposite3
borderStylesolid
<composite xmlns="http://www.osoa.org/xmlns/sca/1.0" targetNamespace="http://sample" xmlns:sample="http://sample"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema" name="Composite3">

    <component name="ComponentE">
        <implementation.java class="sample.ComponentEImpl" />
        <reference name="Reference1" target="ComponentF/Service1" />

        <!-- The property is from the composite Property1 -->
        <property name="Property1" source="$Property1" />
    </component>

    <component name="ComponentF">
        <implementation.java class="sample.ComponentFImpl" />
    </component>

    <service name="Service1" promote="ComponentE/Service1" />

    <reference name="Reference1" promote="ComponentF/Reference1">
        <binding.sca />
    </reference>

    <property name="Property1" type="xsd:string">123</property>

</composite>

1) Two components are implemented by the same composite
 
Path a: Composite1.ComponentB is implemented by Composite3
Path b: Composite2.ComponentD is implemented by Composite3
 
The service/reference can be promoted to different things:
 
a: the final target for the ComponentF.Reference1 is Composite1.ComponentA
b: the final target for the ComponentF.Reference1 is Composite1.Reference1 (pointing to an external service)
 
The property can be set to different value following different composition path:
 
a: Composite3.ComponentE.Property1 is overrided by Composite1.ComponentB.Property1 (say value="ABC")
b: Composite3.ComponentE.Property1 is overrided by Composite2.ComponentD.Property1 (say value="XYZ")
 
To represent the fully-configured components, we need to clone the model for Composite3 for Path a and b so that it can be used to hold different resolved values.