- Introduction
- 16.1 Applying UML: Common Class Diagram Notation
- 16.2 Definition: Design Class Diagram
- 16.3 Definition: Classifier
- 16.4 Ways to Show UML Attributes: Attribute Text and Association Lines
- 16.5 Note Symbols: Notes, Comments, Constraints, and Method Bodies
- 16.6 Operations and Methods
- 16.7 Keywords
- 16.8 Stereotypes, Profiles, and Tags
- 16.9 UML Properties and Property Strings
- 16.10 Generalization, Abstract Classes, Abstract Operations
- 16.11 Dependency
- 16.12 Interfaces
- 16.13 Composition Over Aggregation
- 16.14 Constraints
- 16.15 Qualified Association
- 16.16 Association Class
- 16.17 Singleton Classes
- 16.18 Template Classes and Interfaces
- 16.19 User-Defined Compartments
- 16.20 Active Class
- 16.21 Whats the Relationship Between Interaction and Class Diagrams?
16.7 Keywords
A UML keyword is a textual adornment to categorize a model element. For example, the keyword to categorize that a classifier box is an interface is (shocking surprise!) «interface». Figure 16.1 illustrates the «interface» keyword. The «actor» keyword was used to replace the human stick-figure actor icon with a class box to model computer-system or robotic actors.
Guideline: When sketching UML—when we want speed, ease, and creative flow—modelers often simplify keywords to something like ‘<interface>’ or ‘<I>’.
Most keywords are shown in guillemet (« »)[2] but some are shown in curly braces, such as {abstract}, which is a constraint containing the abstract keyword. In general, when a UML element says it can have a “property string”—such as a UML operation and UML association end have—some of the property string terms will be keywords (and some may be user defined terms) used in the curly brace format.
Figure 16.1 illustrates both the «interface» and {abstract} keywords.
A few sample predefined UML keywords include:[3]
Keyword |
Meaning |
Example Usage |
«actor» |
classifier is an actor |
in class diagram, above classifier name |
«interface» |
classifier is an interface |
in class diagram, above classifier name |
{abstract} |
abstract element; can’t be instantiated |
in class diagrams, after classifier name or operation name |
{ordered} |
a set of objects have some imposed order |
in class diagrams, at an association end |