Parts
Description
The parts element allows for the structural composition of components as part-of an enclosing component type. Enclosed components can be viewed as a private internal implementation strategy of the type.
Nested Elements
The parts element may contain any number of the following elements.
| component | Declaration of a nested component using the Metro component directive. |
| part | Inclusion of a part by reference to a part uri |
Examples
Nested component example
<type class="net.dpml.test.composite.CompositeComponent" name="parent">
<parts>
<component type="net.dpml.test.composite.ChildComponent" key="primary">
<context>
<entry key="color" method="RED"/>
</context>
</component>
<component type="net.dpml.test.composite.ChildComponent" key="secondary">
<context>
<entry key="color" method="BLUE"/>
</context>
</component>
</parts>
</type>
Part by reference example
<type class="org.acme.DefaultGizmo" name="gizmo">
<parts>
<part key="widget" uri="artifact:part:acme/widget/standard-widget#3.1"/>
</parts>
</type>