You can use a UML2 pattern to apply stereotypes on class
properties automatically.
About this task
To automate stereotypes application on class properties,
complete the following steps:
Procedure
- When you are identifying data objects and services, use
the Type to Stereotype pattern. From Pattern
Explorer view drag Type to Stereotype pattern
to your current diagram. See Figure 1.
Figure 1. Dragging the Type to Stereotype pattern
- This pattern takes a package as argument. Choose any package
from your model to apply stereotypes to all subpackages and subclasses.
You can also drag your model root from project explorer to the pattern.
- Apply stereotypes in accordance with primitive types. Stereotypes
icon appears for each class property. See Figure 2.
Figure 2. Applying stereotypes
- If you want to remove stereotypes applied by
this pattern and only those, click Unapply Stereotypes.