Interaction Participants

You show participants in an interaction using a rectangle called a lifeline. The term lifeline illustrates UML's bias toward representing interaction diagrams using the sequence diagram notation. When shown in sequence diagrams, participants have a dashed line dropping down from a rectangle that shows how long the object is actually in existence. When used in other interaction diagram notations, such as communication diagrams, a lifeline is simply a rectangle. You show the name of the participant in the rectangle using the following notation:

            
    object_name [ selector ] : class_name ref decomposition

where:

object_name

Specifies the name of the instance involved in the interaction.

selector

Is an optional part of the name that can identify which particular instance in a multivalued element is to be used (for example, which EventHandler in an array of EventHandlers).

class_name

Is the name of the type of this participant.

decomposition

Is an optional part of the name that can point to another interaction diagram that shows details of how this participant processes the messages it receives (see "Decomposition").

UML defines a reserved participant name, self, that indicates the participant is the classifier that owns this interaction diagram.

Figure 10-2 shows a trivial interaction diagram with two participants and a message between them.

A trivial sequence diagram with two participants

Figure 10-2. A ...

Get UML 2.0 in a Nutshell 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.