Meta-models and Stereotypes

UML is a general purpose language that can be used across many domain.  It gets its strength from the fact that it has a very strong meta-model that defines its semantics and syntax.  These a re defined in the UML2 Meta-class profile.  This profile may be extended (modification should be avoided) to embrace domain specific models and language.  Extensions to UML are done through stereotypes, tag definitions and constraints.  These extensions are grouped into a module called a profile.  A profile may additionally consist of diagrams that articulate how these extensions relate to each other.
A stereotype is a mechanism for specializing some of its elements, imposing new restrictions on them but respecting the UML metamodel, and without modifying the original semantics of the UML elements (i.e., the properties of the UML classes, associations, attributes, etc., will remain the same, but new constraints will be added to their original definitions and relationships).

When you define a stereotype you can optionally add attributes and a constraints that are properties of the stereotype.  You should also specify which UML meta-class the stereotype is applied to.


If you were to create a use case (as we will discuss more clearly in the coming sections, then the stereotype defined above could be applied to as shown below.


This use case above has extra properties (description, id, cost and implications) above those defined in the meta-class (such as description and scenarios etc.).

Stereotypes are a crucial tool in the UML modellers arsenal.