Home

 

Creating references to external diagrams

UML 2.1 provides the capability to reuse interactions that are defined in another context. This provides you the ability to create complex sequence diagrams from smaller and simpler interactions. A reference to another diagram is modeled using the Interaction Use element. Like a combined fragment, an Interaction Use element is represented by a frame. The operator ref is placed inside the descriptor box in the upper left corner, and the name of the sequence diagram being referenced is placed inside the frame's content area along with any parameters for the sequence diagram.

An interaction use can encompass a single activation bar or several lifelines. To create a reference to another sequence diagram:

Select Interaction Use in the palette and place the cursor on an empty space inside the source sequence diagram.

When you drop the cursor, you are prompted to choose the current lifelines that will be covered.

In the Add Covered Lifelines dialog that opens, select the lifelines that should be encompassed by the interaction use element and click OK.

In Figure | -41, the interaction use element references an interaction called sequencediagram2, which provides further information about how the withdrawCash operation is realized.

Figure 7-41 Creating a reference to another diagram

ibm.com/redbooks