Interaction Diagrams


An interaction diagram shows aspects of an interaction. The following subsections describe the four kinds of UML interaction diagrams.

Sequence Diagrams

A sequence diagram focuses on the time-ordering of messages between objects. Figure 8-8 shows an example of a sequence diagram. (The use of an enclosing box and a name for the diagram is optional. The inclusion of the text for the use case with which this diagram corresponds is also optional.)


Figure 8-8: Sequence diagram

Sequence diagrams are excellent vehicles for working your way through use cases and allocating the required behavior to the participating objects. See Use Case Driven Object Modeling with UML [1] for more on this topic. Within the diagram, the use case text is aligned with the associated message(s) so the reader can see how the "how" (the design) matches with the "what" (the analysis). This improves the readability of the diagram and goes a long way toward ensuring that the requirements specified by the given use case are being met by the design.

Note ‚  

Sequence diagrams and communication diagrams (see the next section) are semantically equivalent, which means you can convert one type of diagram to the other without losing any information. However, a sequence diagram has two key features that a communication diagram does not: lifelines and focuses of control.

Communication Diagrams

A communication diagram focuses on the interaction between lifelines, where the architecture of the internal structure and how this corresponds with the message passing is central. The messages are usually notated with sequence numbers , which indicate the relative execution order of the associated messages.

Figure 8-9 shows an excerpt from an example communication diagram.


Figure 8-9: Communication diagram

As mentioned earlier in the chapter, the frame and the figure title are optional.

Note ‚  

Communication diagrams and sequence diagrams (see the section "Sequence Diagrams," earlier in this chapter) are semantically equivalent, which means that you can convert one type of diagram to the other without losing any information. A sequence diagram does not have sequence numbers, but it has a number of features that communication diagrams do not offer.

Since both sequence diagrams and communication diagrams are done at the design level, it makes sense to put them into design-level packages, such as the one shown in Figure 8-10.


Figure 8-10: Design package with sequence and collaboration diagrams

Interaction Overview Diagrams

An interaction overview diagram focuses on the overview of the flow of control within a given interaction. This type of diagram resembles an activity diagram (see the section "Activity Diagrams" in Chapter 6) in that interactions and/or interaction occurrences serve as the activity nodes. All other symbols that appear on sequence diagrams and activity diagrams can appear on interaction overview diagrams.

Figure 8-11 shows an example of what might appear on an interaction overview diagram.


Figure 8-11: Interaction overview diagram

Timing Diagrams

A timing diagram describes the behavior of both individual objects and interactions of those objects, focusing attention on the times of occurrence of events that cause changes in state.

Figure 8-12 shows the elements of a typical timing diagram, as follows :

  • Tick marks

  • A duration constraint (This is a constraint on a duration interval, which represents the range between two given durations; see the section "Intermediate Read and Write Actions" in Chapter 6.)

  • A timing constraint (This is a constraint on a time interval, which represents the range between two given time expressions; this interval is expressed in the form first time..last time .)


Figure 8-12: Timing diagram

[1] Doug Rosenberg with Kendall Scott, Use Case Driven Object Modeling with UML (Boston, MA: Addison-Wesley, 1999).




Fast Track Uml 2.0
Fast Track UML 2.0
ISBN: 1590593200
EAN: 2147483647
Year: 2004
Pages: 97

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net