UML defines a small number of common mechanisms that ensure the notation's conceptual integrity. These common mechanisms comprise stereotypes, tagged values, notes, constraints, dependencies, and type/instance and type/class dichotomies. Each model element has a specification that contains a unique and detailed description of all the characteristics of that element.
Stereotypes, tagged values, and constraints facilitate the extension of UML. Stereotypes specialize metamodel classes, tagged values extend the attributes of the metamodel classes, and constraints extend the metamodel semantics.
Simplified metamodel representation of common mechanisms.
Stereotypes are part of the range of extensibility mechanisms provided in UML. Each UML model element may have one or more stereotypes when the basic semantics of the element are not sufficient. A stereotype allows the metaclassification of a UML element. It permits users (methodologists, tool builders, analysts, and designers) to add new model element classes on top of the kernel predefined by UML. Stereotypes also facilitate the unification of related concepts, such as subsystems or categories, that are expressed using packaging stereotypes. Examples of predefined UML stereotypes are «uses» and «extends».
Stereotypes allow the controlled extension of metamodel classes by UML users. An element specialized by a stereotype
is semantically equivalent to a new metamodel class, also named S
. Pushing this concept to its limit, the whole UML notation could have been constructed using the two classes S
and Thing
, all other concepts being derived by stereotyping the Stereotype
class.Thing
UML's designers have looked for a balance between the built-in classes and the extensions introduced by stereotypes. Therefore, only fundamental concepts have been expressed as distinct classes. Other concepts that can be derived from these basic concepts have been treated as stereotypes.
A tagged value is a (name, value) pair that describes a property of a model element. Properties allow the extension of metamodel element attributes. A tagged value modifies the semantics of the element to which it relates.
A note is a comment attached to one or more model elements. By default, notes do not carry semantic content. However, a note may be transformed into a constraint by using a stereotype and, in that case, it modifies the semantics of the model elements to which it is attached.
A constraint is any kind of semantic relationship between model elements. UML does not specify a particular syntax for constraints, other than that they should appear between braces, so they may therefore be expressed using natural language, pseudo-code, navigation expressions, or mathematical expressions. It should be noted, however, that UML 1.1 does prefer the use of a constraint language called OCL (Object Constraint Language).
The dependency relationship defines a unidirectional use relationship between two model elements referred to, respectively, as the source and target of the relationship. Notes and constraints may also be the source of a dependency relationship.
Many model elements present a type/instance dichotomy, in which the type characterizes the essence of the element, and the instance, with its values, is a manifestation of that type. Similarly, the type/class dichotomy corresponds to the split between the specification of an element, which is described by the type, and the implementation of that specification that is provided by the class.
© 1997 Editions, Eyrolles, Paris, France . All rights reserved.