Add Stereotypes and Metaclasses
To add metaclasses and stereotypes to a Profile, follow the steps below for as many stereotypes and metaclasses as you require:
- Open the child diagram of the Profile Package.
- Drag the Metaclass element from the Profile page of the Toolbox onto the diagram. The Create New Metaclass dialog displays, in which you can tick multiple metaclasses for dropping onto the diagram.
- Scroll down the Element list and select the checkbox for Class.
- Click on the OK button, display the Class Properties dialog, and in the Name field type a name for the element. Click on the OK button again.
- Drag a Stereotype element from the Toolbox onto the diagram. If the Properties dialog does not display, double-click on the element on the diagram.
- In the Name field, type a name for the stereotype.
- Click on the OK button and, if it displays, Close the Generate Code dialog.
- Click on the Extension relationship in the Toolbox and drag the connection from the stereotype element to the metaclass element.
- Your diagram should now resemble the one below:
If you want to have a stereotype extending more than one metaclass, do not create two stereotype Classes with the same name. You cannot have two stereotypes with the same name in the same profile; one is discarded when you save the profile. Therefore, create one stereotype Class with an Extension connector to each of several Metaclass elements, as shown below.