Stereotypes
A stereotype defines a new type of modeling element in the UML. Use stereotypes to define a new type of modeling element and then apply the definition. For example, you might define the concept of a project and the relationship between the project and the things that make up that project.
Defining Stereotypes
In the UML, you
create a stereotype
definition by showing a class representing the stereotype
with a dependency on another class representing the type of modeling
element the stereotype represents. The class representing the new
type of modeling element and the dependency are marked with the
stereotype
keyword, and the class representing the
type of modeling element to which the stereotype applies is marked
with the metaclass
keyword. Each class is shown as
a solid-outline rectangle marked with the keyword enclosed in
guillemets («») or double-angle brackets,
before or above its name. The dependency is shown as a dashed arrow
from the class representing the stereotype to the other class
representing the type of modeling element to which the stereotype
applies.
As I discussed in the beginning of this chapter, rather than have many different efforts relating to a project management system define the concept of a project, I can extend the UML to incorporate a definition of what a project is, which may be reused by all these other efforts. Rather than have many different efforts relating to a project management system define the relationship between a project and the things ...
Get Learning UML now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.