Stereotype (UML)
From Wikipedia, the free encyclopedia
Stereotypes are one of three extensibility mechanisms in UML.
Stereotypes allow you to extend the vocabulary of the UML so that you can create new model elements, derived from existing ones, but that have specific properties that are suitable for your problem domain. They are used for classifying or marking the UML building blocks in order to introduce new building blocks that speak the language of your domain and that look like primitive, or basic, model elements.
For example, when modelling a network you might need to have symbols for representing routers and hubs. By using stereotyped nodes you can make these things appear as primitive building blocks.
Graphically, a stereotype is rendered as a name enclosed by guillemets and placed above the name of another element.
For example, in a class diagram stereotypes can be used to classify method behavior such as «constructor» and «getter».
As another example, «interface» can be considered as a stereotype derived from class.
One alternative to stereotypes, suggested by Peter Coad in his book Java Modeling in Color with UML: Enterprise Components and Process is the use of colored archetypes. The archetypes indicated by different-colored UML boxes can be used in combination with stereotypes. This added definition of meaning indicates the role that the UML object plays within the larger software system.