Why are there keywords and standard stereotypes?

389 views Asked by At

Some times I use keywords like <<use>> and some times standard stereotypes like <<Create>> .

But I wonder why the two notions exist in UML. I feel that keywords could be integrated in a profile.

So does someone knonw why there is a set of keywords AND standard stereotypes ?

1

There are 1 answers

9
Geert Bellekens On BEST ANSWER

Visually there is no way to distinguish a keyword from a stereotype.

Keywords are a notation feature. They are used when there is no other notation available or as an alternative notation. This alternative notation is usually a simple rectangle with the name of the meta-type as keyword.

Keywords are used only for existing meta-classes from the UML meta-model. So in the case of «use» you are actually modelling a Usage relation for which the notation is the same as a Dependency with the addition of the «use» keyword.

Stereotypes on the other hand are an extension of the UML meta-model. By defining a stereotype in a profile you are inventing your own meta-classes who extend existing UML meta-classs. The notation for such an extended meta-class is to show the notation for the standard UML metaclass + the name of the stereotype between guillemets («stereotype»)

The standard stereotypes you are referring to are defined in the UML Standard Profile (see specs 2.5 at page 677).

The Standard Profile specifies a set of predefined standard stereotypes. A conforming tool shall support all of the stereotypes in the Standard Profile.

The example «Create» is defined in this Standard profile as an extension of the Usage meta-class. enter image description here

The reason why some concepts are real meta-classes (such as Usage) and others are extended metatypes (stereotypes) defined in the standard profile (such as Create) is not immediately clear. I personally suspect that this whole Standard Profile is the result of a compromise between the different parties in the committee that had to define the UML specs.
By defining it in the Standard Profile instead of as a proper meta-class it is not really in the specs, but also not really out either.