Interaction Diagrams

Team-Fly    

 
Requirements Analysis: From Business Views to Architecture
By David C. Hay
Table of Contents
Chapter 4.  Column Two: Activities

Interaction Diagrams

A more intricate description of the interaction and communication among objects in the UML is the UML interaction diagram. There are two versions: the sequence diagram and the collaboration diagram. The UML sequence diagram shows a set of objects across the top of a page and the communications among them as a set of parallel lines. A collaboration diagram is similar to a data flow diagram, but instead of communications between activities, it shows communication between objects. Both of these diagrams are important for object-oriented design, but it is not clear how effective they are for analysis. Still, they represent an interesting exercise.

A sequence diagram is shown in Figure 4.23. Each is arranged with a set of objects laid out across the top of the diagram. (Again, what are shown are representative objects of a class, not the class.) Down the page are a series of horizontal arrows, representing transactions (activities sending messages), arranged in chronological order, with each showing a communication between two or more objects.

Figure 4.23. Interaction (Sequence) Diagram.

graphics/04fig23.gif

In a sequence diagram, the vertical rectangles represent the life of the object. Where an object is destroyed, an "X" below the rectangle shows this. In Figure 4.23 the object "o:PurchaseOrder" is created in response to the transaction "createOrder" and destroyed by the transaction "closeOrder."

Figure 4.24 shows a collaboration diagram. In this, the objects are linked together, and the activities that send messages from one to another are listed along the side of each link. The sequence of the activities is shown in the lists, not graphically, as is the case with the sequence diagram. Figure 4.24 is logically equivalent to Figure 4.23.

Figure 4.24. Interaction (Collaboration) Diagram.

graphics/04fig24.gif


Team-Fly    
Top
 


Requirements Analysis. From Business Views to Architecture
Requirements Analysis: From Business Views to Architecture
ISBN: 0132762005
EAN: 2147483647
Year: 2001
Pages: 129
Authors: David C. Hay

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