Next: Specifying Ports, Up: Decomposing a Component [Contents][Index]
The components within a system can also be composite components, so it is possible to define systems of systems.
Composite components can also expose ports of contained components by binding their own provided or required ports to ports of contained components. In that case the binding looks like
port <=> component1_instance_name.port
The keyword system is used to define a composition. Inside the system definition the instances of the components that are contained in the system are specified.
To define a system inside the composite component use:
component Composition { system { Component1 component1instance; Component2 component2instance; // binding of the components: // where Component1 provides or requires port1 // and Component2 requires or provides port1 component1instance.port1 <=> component2instance.port1; } }
Within a system components have to be connected together. A binding statement takes the form of
component1_instance_name.port <=> component2_instance_name.port
Only ports with an equal interface definition and opposite direction can be bound together.
Composite components can also expose ports of contained components by binding their own provided or required ports to ports of contained components. In that case the binding looks like
port <=> component1_instance_name.port
component Composition { provides Interface1 port1; system { Component1 component1instance; Component2 component2instance; // binding of the components: // where Component1 provides port1; // where Component1 provides or requires port2 // and Component2 requires or provides port2 port1 <=> component1instance1.port1 component1instance.port2 <=> component2instance.port2; } }
Here a component is decomposed into two other components C1 and C2.
interface I1 { in void event(); } component C1 { provides I1 i1; } component C2 { requires I1 i1; } component Decomposition { system { C1 c1; C2 c2; c1.i1 <=> c2.i1; } }
Here a component is decomposed into two other components C1 and C2 and the interface provided by component C2 is exposed.
interface I1 { in void event(); } interface I2 { in void event(); } component C1 { provides I1 i1; } component C2 { provides I2 i2; requires I1 i1; } component Decomposition { provides I2 i2Proxy; system { C1 c1; C2 c2; i2Proxy <=> c2.i2; c1.i1 <=> c2.i1; } }
Next: Specifying Ports, Up: Decomposing a Component [Contents][Index]