11.5. Roles

Each end of an association is called a role. Roles may optionally have:

  • name

  • multiplicity expression

  • navigability

Multiplicity is examined next, and the other two features are discussed in later chapters.

Multiplicity

Multiplicity defines how many instances of a class A can be associated with one instance of a class B (see Figure 11.3).

Figure 11.3. Multiplicity on an association.

For example, a single instance of a Store can be associated with “many” (zero or more, indicated by the * ) Item instances.

Some examples of multiplicity expressions are shown in Figure 11.4.

Figure 11.4. Multiplicity values.

The multiplicity value communicates ...

Get Applying UML and Patterns: An Introduction to Object-Oriented Analysis and Design and the Unified Process, Second Edition 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.