User-defined data type
Via a user-defined data type (“Data Unit Type” = DUT) the user can define data types, e.g. in the form of structures or enumerations.
A user-defined structure data type can have the following relationship type:
- Generalization: a structure can inherit from another structure.
A user-defined data type is represented by a two-part rectangle in pale yellow and overwritten with <<struct>>, if it is a structure or a union. <<enum>> indicates an enumeration type. The identifier follows in bold. All attributes are shown after the first dividing line:
<attribute name>: <data type>
Properties
“Property” |
Description |
---|---|
“Identifier” |
Insert or change an unique name of the selected element. |
Edit DUT
The following user inputs are available if “Selection” is enabled in the toolbox (default).
User input in the class diagram | Response in the class diagram | Description |
---|---|---|
Select the tool "Data Unit Type (DUT)": Click in an empty area of the diagram. The dialog “Add DUT” opens. Enter a name for the new object, adjust the settings and close the dialog with "Add". | A data type object is created. | The object exists in the diagram and in the project. The view in the project tree is updated automatically. |
Click on a DUT. | Icons are visible to the left above. | |
Click on | DUT is only removed from the diagram. | Use "flat" removal to remove it from the class diagram view only. The object still exists and is visible in the project tree. |
Click on | DUT is removed from the diagram and the project. | The object is removed. It then no longer exists. |
Click on | A generalization points from the existing DUT to the new DUT. The existing DUT inherits from the new one. | The existing DUT contains the declaration. Example: TYPE ST_Sample EXTENDS ST_New |
Click on | A generalization arrow points from the second DUT to the first DUT. | The first DUT inherits from the second DUT. The first DUT contains the declaration. Example: TYPE ST_Sample EXTENDS ST_Existent |
Click on |
| The attribute or operation list is minimized. |
Click on |
| The attribute or operation list expands. |
Double-click on the identifier. Then change the name in the line editor. | After the first click, the name has a blue border. After the second click the line editor opens. | The change is applied synchronously and automatically to the project. |
Double-click the element. | The corresponding object editor opens. | Edit the declaration or implementation. After closing of the editor you are returned to class diagram. The changes are automatically applied to the class diagram. |
![]() | The default settings in the dialog “Add DUT” originate from the last application of this dialog. |
Sample
- Generalization
TYPE ST_Sub EXTENDS ST_Sample :
STRUCT
aMessages : ARRAY[1..10] OF STRING;
END_STRUCT
END_TYPE