Tips and Tricks
Diagramming Topics

Using Stereotypes

A stereotype denotes a variation on an existing modeling element with the same structure but with a difference in meaning. UML stereotypes can be used to further define additional constraints and tag definitions of a model element in a UML diagram. Stereotypes can be applied to almost any diagram in the UML.

In this article, we will show you how to set the stereotype for a model element, how to customize the properties and appearance of the available stereotypes as well as defining tagged values of a stereotype for a model element.

Setting Stereotypes for Model Elements

  1. You can start by creating a new class diagram and drawing the following class diagram.


  2. Right-click on the Order class, select Open Specification... from the pop-up menu. A Class Specification dialog box is displayed.


  3. Click on the Stereotypes tab, highlight the stereotype from the stereotype list then click the Add Selected button to select the highlighted stereotype (for example, entity stereotype is selected). Click the Apply button to confirm the changes.


  4. The Order class is tagged with the entity stereotype.


Editing Stereotypes for Model Types

After successfully setting a stereotype for a model element, you can also edit the existing stereotypes to change their properties and appearance in the diagram.

  1. From the Class Specification dialog box click the Edit Stereotypes... button. A Configure Stereotypes dialog box is displayed.


  2. Select the stereotype from the stereotypes list for editing. Click on the Edit... button. The Stereotype Specification dialog box is displayed. For example, entity stereotype is selected.


  3. You can modify the details of the stereotype such as its name, icon or documentation. For example, to modify the icon of the entity stereotype, click on the ... browse button. Select the image file from the explorer window then click on the Open button. A new icon will be displayed for the entity stereotype.






Defining Default Tagged Values for Model Types

Furthermore, VPUML also allows you to add default tagged values for model types through stereotypes. You can define the default tagged values of the model types by adding tagged values to the stereotypes and then applying those stereotypes to the model elements.

  1. From the Configure Stereotypes dialog box, select the desired stereotype then click on the Edit... button.


  2. The Stereotype Specification dialog box is displayed. Click on the Tagged Value Definitions tab.


  3. Click on the Add button and select Text Tag from the pop-up menu. A new tag row is created.


  4. To specify the default value of the Tag, double-click the Default Value field and enter a value. Click on the OK button to close the dialog box.


Related Articles

Resources

 
 
Last modified: 2007/08/18 04:02
 
 
Home | Recent Topics | Highlights | UML Diagrams | Tips and Tricks | Object-Relational Mapping
visual-paradigm.com Home | Training Center | UML Center | VP Gallery | Discussion Forum | UML Open Directory