Specifying stereotypes and constraints for custom UML profiles
About this task
Note: Although you can create and modify profiles using the Project
Explorer view, you can also visually model profiles by
using class diagrams. Creating and modifying a profile in a diagram
is faster than modifying a profile in the Project Explorer
view.
- Adding stereotypes to custom UML profiles
You can create stereotypes to include in a custom UML profile. When you apply a profile to a model, you can use the stereotypes of the profile to mark up the model for a particular domain or platform. - Applying a suppressed stereotype for individual elements
You can apply a suppressed stereotype on a per-element basis by using the taggedValueSet keyword on the stereotype. Once a stereotype is suppressed, it will not appear in the Project Explorer view or diagram editor. - Associating stereotypes with UML model elements
You can specify the types of model elements that a stereotype extends. When you apply a profile to a model, you can only apply the stereotypes that are applicable to the types of model element that the stereotypes extend. - Associating stereotypes with stereotypes in UML profiles
You can add stereotype associations to create links between stereotypes in a custom UML profile. After you apply the custom profile to a model and apply the stereotypes to model elements, you can associate the model elements with each other by using the defined roles in the profile. - Associating stereotypes with UML metaclasses in custom UML profiles
You can associate stereotypes with UML metaclasses in custom UML profiles. After you apply the custom profile to a model and apply the stereotype to a model element, you can associate that element with model elements that have the same metaclass as the association. - Adding stereotype generalizations to custom UML profiles
You can use a stereotype generalization to build a stereotype in a UML profile that inherits the properties of another stereotype. These properties include the stereotype's attributes and constraints. The concept of stereotype generalization is similar to class generalization. When you apply the stereotype to a model element, the model element includes both the properties of the applied stereotype and generalized stereotype. - Specifying read-only stereotypes in UML profiles
You can specify stereotypes in profiles as read-only so that team members cannot manually apply or remove read-only stereotypes in a model. - Specifying read-only stereotype attributes in UML profiles
You can specify read-only stereotype attributes in profiles. - Specifying icons and graphics for UML stereotypes
You can specify an icon and a graphic to identify each stereotype that you create. When you apply the stereotype to a model element, the specified icon is displayed beside the stereotype name and the specified graphic replaces the default graphic for a diagram element in the diagram editor. GIF or JPG files are the recommended file formats for stereotype icons and SVG is the recommended file format for diagram editor graphics. - Adding attributes to UML stereotypes
In UML models, attributes represent information, data, or properties. You can add attributes to UML stereotypes. You can also specify the data type of attributes. - Adding constraints to custom UML profiles
You can specify constraints within a stereotype in a custom UML profile. When you define Object Constraint Language (OCL) constraints, the constraints are validated syntactically, except for Java™ constraints. When you apply a stereotype to a model element, the attributes of the stereotype are added to the model element. Stereotype constraints apply to the attributes of the model element to which the stereotype is applied. - Adding enumerations to custom UML profiles
In UML models, enumerations are model elements that represent user-defined data types. Enumerations contain sets of named identifiers, called enumeration literals, that represent the values of the enumeration. Enumerations can represent primitive types, such as integer and Boolean types, or user-defined types.
Previous topic: Authoring UML profiles with class diagrams
Next topic: Generating profile tooling
Related concepts:
Feedback