What is UML Stereotype? How to Define it?

Stereotypes is extensibility mechanisms in UML which allows designers to extend the vocabulary of UML in order to create new model elements. By applying appropriate stereotypes in your model you can make the specification model comprehensible.

February 02, 2016
Views: 120,627
PDF Download
Stereotyped shapes

A stereotyped model type can appear many times within a project. For example, when modeling an online shopping system with a use case diagram, you might have multiple actors who are <<administrator>>. The same applies to class models, where you might have multiple <<Enum>> or <<Model>> classes. When a stereotyped model type is used so frequently that it becomes a primitive building block in a model, allowing direct creation saves time by avoiding repeated redefinition. This article demonstrates how to configure the diagram toolbar to easily create a stereotyped model element.

Configuring the Diagram Toolbar

  1. Right-click on the diagram toolbar of the opening diagram and select Configure Buttons from the popup menu.
    Select Configure button
  2. In the Configure Buttons window, expand the tree node of the desired model element type.
    Expand type node
  3. Click > to add the stereotype(s) to the selection.
    Select stereotype
  4. Now, you can create the selected type(s) of class via the diagram toolbar. To do this, click the element type button in the diagram toolbar and select the chosen element type from the popup menu.
    Select stereotyped element
  5. Click on the diagram to create such an element.
    Element created

Auxiliary Options

There are auxiliary options for rearranging items in the diagram toolbar to make selection easier. We will go through two of them.

Show Name displays button names when enabled. Turning it off can reduce the space consumed by the buttons. Show name

Expand Group expands all collapsed groups so that all stereotyped model types are visible and ready for direct selection. Expand Group