A profile diagram enables you to create domain and platform specific stereotypes and define the relationships between them. You can create stereotypes by drawing stereotype shapes and relate them with composition or generalization through the resource-centric interface. You can also define and visualize tagged values of stereotypes.
Creating a profile diagram
To create a profile diagram:
- Select Modeling > Profile > New Profile from the toolbar
- Name the diagram and press Enter to confirm.
Drawing a stereotype
To draw a stereotype in profile diagram:
- Select Stereotype in diagram toolbar.
- Click on the diagram to create a stereotype.
- In the Select Base Type of Stereotype window, select the base type of stereotype from the model type tree. A base type is the type of model element that the stereotype will extend.
Note: You can check Display model element types in-use to list only the types of model elements used in project. The text box Filter enables you to filter model element type base on the type name. (e.g. enter class to list only class)
- Click OK. Name the stereotype and press Enter to confirm creation.
Defining tagged values for stereotypes
A stereotype may have properties, which may be referred as tag definitions. When a stereotype is applied to a model element, the values of the properties may be referred as tagged values.
You can define tagged values for a stereotypes. By doing so, when you apply the stereotype with tagged values defined to a model element, you can fill in the values for the model element.
- Right click on a stereotype shape and select Open Specification… from the popup menu.
- In the Stereotype Specification window, open the Tagged Value Definitions tab.
- Click Add. Select the type of tagged value to define. The type of tagged value limits the type of content user can enter for a tag.
Tag type Description Text The most common and general type of tagged value that consists of words. Multi-line Text The value of tag is a text in multiple lines. Model element The value of tag is a model element in project. Enumeration The value of tag can be chosen from a list of possible values. For example, to select “red” out of values red, green and blue. Integer The value of tag must be a real number. Floating point number The value of tag must be a number that consists of one or more digits. Boolean The value of tag is a boolean (true/false).
- Double click the name cell and enter the name of tag. Repeat step 3 and 4 to add all tagged values for this stereotype.
- You can assign a default value to a tag by editing the Default Value cell. Usually, you give a tag a default value when the value is true in most cases. For example, a tag “in-door-temperature” can have “25” as default value. By confirming changes, you can see the stereotype show on diagram, with tagged values show below the stereotype name.
Stereotypes can be related with each other by composition or generalization. Relating stereotypes not just affect the modeling in profile, but also the model elements that the stereotypes will be applied to.
A composition relationship shows a “part of” relationship between stereotypes. The composite stereotype has responsibility for the existence and storage of the composed stereotype.
To create a composed stereotype:
- Move the mouse pointer over a stereotype. Press on the Resource Catalog button and drag it out.
- Select Composition -> Stereotype from Resource Catalog.
- Name the stereotype and press Enter.
Since composition models a “part of” relationship, when you apply a composite stereotype to a model element, you can add tagged value defined in composed stereotype in the model element. For example, stereotype Vehicle is composed of stereotype Wheel. If you apply stereotype Vehicle to a class, you can specify the properties of tagged values as defined by both stereotype Vehicle and Wheel.
A generalization relationship shows a “kind of” relationship between stereotypes.
To create a specific stereotype from a general stereotype:
- Move the mosue pointer over a stereotype. Press on the Resource Catalog button and drag it out.
- Select Generalization-> Stereotype from Resource Catalog.
- Name the stereotype and press Enter.
Since generalization models a “kind of” relationship, when you apply a specialized stereotype to a model element, you can add tagged value defined in general stereotype in the model element. For example, stereotype Vehicle is a generalized stereotype of Truck. If you apply stereotype Truck to a class, you can specify the properties of tagged values as defined by both stereotype Vehicle and Truck.