A stereotype defines how an existing metaclass may be extended. It enables the use of a platform, a domain specific terminology, or a notation in place of, or in addition with, the ones used for the extended metaclass. Similar to a class, a stereotype may have properties which may be referred to as tag definitions. When a stereotype is applied to a model element, the values of the properties may be referred to as tagged values. A stereotype can extend any model element from the reference metamodel (any UML model element). For example in UML, States, Transitions, Activities, Use cases, Components, Attributes, Dependencies, etc. can all be extended with the stereotypes. The stereotypes are created as separate model elements and can be drawn in almost all diagrams. You can specify stereotype properties in the stereotype Specification window. In the same window, you can find the description of each property. Descriptions are presented in the description area of the Specification window. Stereotype notation in diagrams use the guillemets instead of symbols «» (see the following figure). However, when editing elements in a diagram, you can still enter the stereotype names between the «» symbols. 
The following procedures describe how to work with stereotypes:

Creating a stereotypeTo create a stereotype, do one of the following
- Open or create the Profile Diagram. On the diagram pallet, click the Stereotype button and place it on the diagram pane.
- In the Containment tree, select a Profile, and from the shortcut menu, select Create Element > Stereotype.
Creating stereotype with an imageTo create a stereotype with an image
- In the stereotype's Specification window, click the Icon specification cell to edit and select an image you want to place for the stereotype by selecting an image form:
- the image library, click
. - the file system, click
. - using URL, click
.
- Select an image and click the Open button.
- Close the Specification window.
Applying a stereotype
To apply a stereotype, do one of the following:
You can change the order of the stereotypes applied to the element. The symbol style of the first stereotype in the list will be applied to the element. |
Changing the stereotype’s metaclassTo change the stereotype’s metaclass
- Do one of the following:
- On a diagram pane, select the stereotype and from its smart manipulator toolbar, choose the Metaclass button.
- In the stereotype’s Specification window, click the specification value cell, and then click
.
- In the list, select the metaclass you want to apply.
- Click Apply when you are done.
Displaying the stereotype icon instead of the shape on the diagram paneTo display the stereotype icon instead of the shape on the diagram pane
- Select the shape on the diagram and click the Compartments smart manipulator.
- Click
to expand the menu and select Suppress All.
View assigned image propertiesTo view assigned image properties
- In the stereotype Specification window, right-click the Icon property specification cell and select Open Specification. The Image specification window opens wherein you can see and specify image properties.
Changing the order of the stereotypes
If a symbol has several stereotypes applied, you can change the order of stereotypes for visual purposes. To change the order of the stereotypes
- Right-click the symbol to open the shortcut menu, click Stereotype. The Select Stereotype dialog opens.
- Click the Order button. The Order Stereotypes dialog opens.
- Select a stereotype and click Up or Down buttons to change the order of the stereotypes.
Saving the stereotype information in XMIYou can choose the location of the applied stereotypes' information in the XMI file. Information can be saved at the end of the file or inside the element's information. By default, stereotype information is stored at the end of the XMI file. To store information inside an element
- From the main menu, select Options > Environment.
- The Environment Options dialog opens.
- In the General options group > Save/Load, set the Save Stereotype Information within Element to true.
|
Changing the stereotype display modeYou can change the stereotype name and its icon visibility on an element's shape. To change the stereotype display mode on the element shape
- Click the shape, and then, click buttons to suppress all the compartments.
- Click the shape and then click the Compartments button. From the menu, click the Stereotypes and then select a desired display mode that are described in the following table:
Show Stereotypes Property Value | Shape | Icon of the stereotype on the shape | Name of the stereotype | Image of the stereotype instead of the element shape |
---|
Text and icon | | displayed | displayed | - | Text | | not displayed | displayed | - | Icon | | displayed | not displayed | - | Shape Image and Text | | - | displayed | displayed* | Shape Image | | - | not displayed | displayed* | Do Not Display | | not displayed | not displayed | - |
* To display the image of a stereotype instead of the element shape, all element compartments should be suppressed.
|