blob: ea19ad7c16ef8349cf65651c63f3b9f8fed69cba [file] [log] [blame]
h2. Components Model
The AMALTHEA component model is central accessible through the __ComponentsModel__ element.
It holds the following types:
* *Components* / *Composites*
* *Systems*
* *Interfaces*
* *Structures*
!(scale)../pictures/model_components.png!
h3. Component Interfaces
!(scale)../pictures/model_components_interface.png!
*TODO* implemented interfaces of a connector
h3. Structure of Systems / Composites
The inner structure of a System or a Composite is defined with the ISystem interface. Both elements contain component instances and connectors. The ports of the instances and the containing structure can be identified as QualifiedPort.
!(scale)../pictures/model_components_composition.png!
h3. Components Model Elements
The elements of the Components Model inherit several capabilities from common elements.
!(scale)../pictures/model_components_common.png!
Ports, Components, Composites and ComponentInstances are referable by unique names.
A Connector also has a name but the name is optional and does not have to be unique.
h4. Component
The 'Component' class represents a component. Components could be created directly within the 'ComponentModel' and are used as a type for a component instance.
!(scale)../pictures/model_components_component_references.png!
It contains several ports of type 'Port'. A component refers the classes 'OsEvent', 'Label', 'Runnable' and 'AbstractProcess' from the software model and the class 'Semaphore' from the OS model.
h4. System and Composite
Systems are defined as top level elements within a component model. A system contains several Component- and
Connection-instances and is used to define the architecture of a technical system.
A 'Composite' is a special component type to aggregate Component- and Connection-instances compositely.
So it could be used to create hierarchical component structures.
System and Composite implement the interface 'ISystem'.
The following diagram shows the main elements to represent the hierarchical structure.
!../pictures/model_components_isystem.png!
In general each inner port should be connected. If a port is intentionally left unconnected it has to be added to the list of 'groundedPorts'.
h4. ComponentInstance and Connector
The 'ComponentInstance' and the 'Connector' can be created within a 'System' or a 'Composite'. 'ComponentInstances' are used to represent instances of component- or composite-types. The 'Connector' class is used to connect the component instances to each other via their Ports. The connector contains a source and target 'QualifiedPort'.
h4. QualifiedPort
A 'qualified' port refers a 'ComponentInstance' and a 'ComponentPort'.
If the 'instance' link is null then the QualifiedPort refers to a port of the enclosing composite.
h4. ComponentPort
The 'ComponentPort' class contains the attribute 'kind' to set the port direction.
The attribute 'interface name' can be used to refer to an external definition, e.g. described in detail with the Franca IDL.
h3. Example
h4. Diagram
The diagram of the example shows a composite 'A' that contains two component instances 'X' and 'Y' of type 'B'. The connections between the ports are named 'c1' to 'c4'. The grounded port 'in_3' of instance 'X' (intentionally left unconnected) is marked green. The second unconnected port 'in_2' of instance 'Y' is unspecified. It is marked red and has to be changed, either declared as grounded or connected to another port.
!../pictures/model_components_example.png!
h4. Model Editor
The same example is shown in the standard AMALTHEA editor.
!../pictures/model_components_example_treeview.png!