Aggregation References
In Aggregation References, one element groups several other elements into a whole. Most prominently, they are used to describe the relation between Programs and Modules.
Aggregations:
- Are one-directional.
- Are not strictly hierarchical. Children can exist outside the parent and can often be referenced by multiple children.
- Can target ElementClasses from other ontologies, as long as there is a dependency in that direction.
- Require the target ElementClass to have identifiers.
model/references/Executable_scriptModules.xml
<reference name="scriptModules">
<associationType name="aggregation"/>
<owner name="Executable" ontology="scriptElements"/>
<target name="ScriptModule" ontology="scriptElements"/>
<cardinality>
<minimum>0</minimum>
<maximum>*</maximum>
</cardinality>
</reference>
Aggregation in action
DemoCli.xml
<executable>
<scriptModules>
<scriptModule>export</scriptModule>
<scriptModule>import</scriptModule>
</scriptModules>
</executable>
export.xml
<scriptModule>
<name>export</name>
</scriptModule>
import.xml
<scriptModule>
<name>import</name>
</scriptModule>