Stereotype is a profile class which defines how an existing metaclass may be extended as part of a profile. It enables the use of a platform or domain specific terminology or notation in place of, or in addition to, the ones used for the extended metaclass.
A stereotype extends the vocabulary of the UML, allowing to create new kinds of building blocks that are derived from existing ones but that are specific to the problem. For example, during modeling a network, designers deal with concepts like routers and hubs. By creating stereotypes for them, UML is extended by new building blocks that have special properties, semantics and notation.
A stereotype cannot be used by itself, but must always be used with one of the metaclasses it extends. Stereotype cannot be extended by another stereotype.
A stereotype uses the same notation as a class, with the keyword «stereotype» shown before or above the name of the stereotype. Stereotype names should not clash with keyword names for the extended model element.
Stereotype can change the graphical appearance of the extended model element by using attached icons represented by the Image profile class.
Because stereotype is a class, it may have properties. Properties of a stereotype are referred to as tag definitions. When a stereotype is applied to a model element, the values of the properties are referred to as tagged values.
Figure 6.9. Device extended by Server stereotype with tag definitions and custom icon [UML-DIAGRAMS.ORG]
![]() |
Profile diagram is used to show definition of stereotype. Stereotype is applied when it is used on use case diagrams, class diagrams, deployment diagrams, etc.
When a stereotype is applied to a model element, an instance of the stereotype is linked to an instance of the metaclass. The name of the applied stereotype is shown within a pair of guillemets («») above or before the name of the model element.
UML versions before 2.4 required the first letter of the name of the applied stereotype to be in lower case (e.g. «servlet»). Starting from UML 2.4, the first letter should normally be in upper case. Naming stereotype applications with lower-case letters where the stereotypes themselves are defined using upper-case first letter is still valid but is considered obsolete.
If multiple stereotypes are applied to the same element, the names of the applied stereotypes are shown as a comma-separated list within a pair of guillemets.
When the extended model element has a keyword, then the stereotype name could be displayed close to the keyword, within separate guillemets (example: «device» «server»).
When a stereotype includes the definition of an icon, this icon can be graphically attached to the model elements extended by the stereotype. Every model element that has a graphical presentation can have an attached icon. When a model element is extended by one single stereotype the icon can be presented in a reduced shape, inside and on top of the box representing the model element.
When stereotype is applied, the whole classifier box can be replaced by enlarged icon of the stereotype.
Some model elements are already using an icon for their default presentation. A typical example of this is the actor model element, which uses the "stickman" icon. In that case, when a model element is extended by a stereotype with an icon, the stereotype’s icon replaces the default presentation icon within diagrams.
A stereotype must always be used in conjunction with one of the metaclasses it extends. A metaclass may be extended by one or more stereotypes. Each stereotype may extend one or more metaclasses.
Stereotypes can participate in binary association. The opposite class can be another stereotype, a non-stereotype class owned by a profile or a metaclass. The stereotype must own property at the association end to be able to navigate to the opposite class. If the opposite end is not a stereotype, the opposite property must be owned by the association itself.
A stereotype may generalize or specialize only another stereotype.
Figure 6.15. Abstract stereotype Session EJB is specialized by stereotypes Stateless EJB and Stateful EJB [UML-DIAGRAMS.ORG]
![]() |