Creating stereotypes
Creating a stereotype
Stereotypes are specific metaclasses, indicated by the “stereotype” keyword. They are used to extend metaclasses from the UML metamodel through extension links (black-arrowed generalizations).
Stereotypes can be created by clicking on the
icon from a profile.
Steps:
1. In the explorer, click on the profile inside which you want to create a new stereotype.
2.
Click on the
icon.
3. Name the stereotype and associate the graphic representations of your choice, and then confirm (if you do not wish to associate a graphic representation, then simply leave the “Icon”, “Small icon” and “Explorer icon” fields empty).
After confirmation of creation, the following elements are created:
· a class stereotyped “stereotype” with the name entered in the “Name” field of the “Stereotype” dialog box.
· three tagged values, ({icon}, {smallIcon} and {explorerIcon}). If you have defined icons to be used as the graphic representation of stereotypes, these tagged values indicate their location.
· a static diagram named “Detailed view of Xxxx”, providing a detailed view of the stereotype.
The “Stereotype” dialog box

Figure 85. The "Stereotype" dialog box
Key:
· “Name”: This field is used to enter the name of the stereotype.
· “Icon”: This field is used to enter the path of the icon which will be used as the graphic representation of the stereotyped element in diagrams.
· “Small icon”: This field is used to enter the path of the icon which will be used as the graphic representation of the stereotyped element in reduced form.
· “Explorer icon”: This field is used to enter the path of the icon which will be used as the graphic representation of the stereotyped element in the explorer.
· “OK”: This button is used to create a stereotype.
· “Cancel”: This button is used to close the dialog box without creating the stereotype.
Defining the extension
The example shown in Figure 86 illustrates the extension of a metaclass by a stereotype.

Figure 86. Extending a metaclass by a stereotype
Steps:
1. In the explorer, click on the stereotype for which the extension should be defined.
2.
Click on the
icon.
3. The dialog box of the metaclass to be extended opens. In this box, it is possible to enter the name of the class to be extended, to drag-and-drop the metaclass, or to select it in the directory tree.
After confirmation of creation, a generalization link with the “extension” stereotype (represented by a black triangle) is created between the stereotype and the metaclass.
Inheriting from a defined stereotype
Unlike the definition of a stereotype on a metaclass through a generalization link stereotyped “extension”, if you want to inherit from an already defined stereotype, you should create a classic generalization in the UML sense of the term (represented by a white triangle).
Stereotypes can have generalization dependencies between each other, but cannot have extension dependencies. If a generalization between stereotypes carries the “extension” stereotype, then the following error will appear when consistency checks are run:
“JavaConstructor”: the generalization link to
the “JavaConstructor” stereotype must not be stereotyped.

Figure 87. Procedure for extending an
existing stereotype
Graphic representation of stereotypes
When a new stereotype is created, three different graphic representations can be associated with it:
· a graphic representation of the stereotyped element in diagrams (defined in the “Icon” field when creating a stereotype). We recommend that the size of this icon be 48*48 pixels.
·
a graphic representation of the
stereotyped element in the explorer (defined in the “Explorer icon”
field when creating a stereotype). We recommend that the size of this icon be
·
a graphic representation for
reduced form representation of the stereotyped element (defined in the “Small
icon” field when creating a stereotype). We recommend that the size of this
icon be
Icons must be in “.bmp” or “.png” format.
If no icons are present, only the textual representation of the stereotype (between the “ ” characters) will be displayed in diagrams.
The icons used to graphically represent stereotypes can be located within any accessible directory. During the compilation phase, a “res/bmp” directory is automatically created in the MDA component directory, and the specified files copied to this directory. When the MDA component is packaged, the files copied into the MDA component directory are known to the MDA component and can be used by the MDA component.
Toolbar
The icons appearing in the “MDA” tab of the auxiliary window can be used to run the following commands:
|
Icon |
Description |
|
|
This icon is used to open this page. |
|
|
This icon is used to create/update diagrams, even if the “Create/update MDA diagrams automatically” option is deactivated. |
|
|
This icon is used to check that the stereotype has been correctly modeled. |