0% found this document useful (0 votes)
165 views5 pages

Lab 07 (Interaction Diagram)

This document discusses interaction diagrams, including sequence diagrams and communication diagrams. It provides examples and descriptions of how each diagram type can be used to visualize the interactive behavior of a system by focusing on the sequence and organization of message passing between objects. Sequence diagrams emphasize the time sequence of messages while communication diagrams emphasize the structural organization of objects.

Uploaded by

Wasie Urrahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
165 views5 pages

Lab 07 (Interaction Diagram)

This document discusses interaction diagrams, including sequence diagrams and communication diagrams. It provides examples and descriptions of how each diagram type can be used to visualize the interactive behavior of a system by focusing on the sequence and organization of message passing between objects. Sequence diagrams emphasize the time sequence of messages while communication diagrams emphasize the structural organization of objects.

Uploaded by

Wasie Urrahman
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

Course Code: Software Design & Architecture.

Lab 07: Interaction Diagram

Interaction diagram:
From the term Interaction, it is clear that the diagram is used to describe some type of
interactions among the different elements in the model. This interaction is a part of dynamic
behavior of the system.
This interactive behavior is represented in UML by two diagrams known as Sequence diagram
and Collaboration diagram. The basic purpose of both the diagrams is similar.
Sequence diagram emphasizes on time sequence of messages and collaboration diagram
emphasizes on the structural organization of the objects that send and receive messages.
The purpose of interaction diagrams is to visualize the interactive behavior of the system.
Types of Interaction Diagrams:
 Sequence diagram
 Communication Diagram
Sequence Diagram:
 Sequence diagram is the most common kind of interaction diagram, which focuses on the
message interchange between a numbers of lifelines.
 Sequence diagram describes an interaction by focusing on the sequence of messages that
are exchanged, along with their corresponding occurrence specifications on the lifelines.
 The following nodes and edges are typically drawn in a UML sequence diagram:
– Lifeline, execution specification, message, combined fragment, interaction use,
state invariant continuation destruction occurrence.
Example:

The sequence diagram has four objects (Customer, Order, SpecialOrder and NormalOrder).

The following diagram shows the message sequence for SpecialOrder object and the same can
be used in case of NormalOrder object. It is important to understand the time sequence of
message flows. The message flow is nothing but a method call of an object.

The first call is sendOrder () which is a method of Order object. The next call is confirm
() which is a method of SpecialOrder object and the last call is Dispatch () which is a method

Centre for Advance Studies in Engineering Page 1


Course Code: Software Design & Architecture.
Lab 07: Interaction Diagram

of SpecialOrder object. The following diagram mainly describes the method calls from one
object to another, and this is also the actual scenario when the system is running.

Communication Diagram:
 Communication diagram (called collaboration diagram in UML 1.x) is an interaction
diagram which shows interactions between Objects and/or parts (represented as lifelines)
using sequenced messages in a free-form arrangement.
 Communication diagram corresponds (could be converted to/from or replaced by) to
simple sequence diagram.
Example:
Collaboration diagram shows the object organization as seen in the following diagram. In the
collaboration diagram, the method call sequence is indicated by some numbering technique. The
number indicates how the methods are called one after another. We have taken the same order
management system to describe the collaboration diagram.

Centre for Advance Studies in Engineering Page 2


Course Code: Software Design & Architecture.
Lab 07: Interaction Diagram

Method calls are similar to that of a sequence diagram. However, difference being the sequence
diagram does not describe the object organization, whereas the collaboration diagram shows the
object organization.
To choose between these two diagrams, emphasis is placed on the type of requirement. If the
time sequence is important, then the sequence diagram is used. If organization is required, then
collaboration diagram is used.

Centre for Advance Studies in Engineering Page 3


Course Code: Software Design & Architecture.
Lab 07: Interaction Diagram

Sequence Diagram with if-else Conditions and Loop:

Centre for Advance Studies in Engineering Page 4


Course Code: Software Design & Architecture.
Lab 07: Interaction Diagram

Question No 1:

 Create a sequence diagram of online shopping system. Consider following requirements.


 Customer browses through catalog and selects items to buy.
 Customer goes to checkout.
 Customer fills out shipping information.
 System presents full pricing information, including shipping information.
 Customer fills in credit card information.
 System authorizes purchase.
 System confirms sale immediately.
 System sends confirming email to customer

You can use following class diagram as a reference.

Centre for Advance Studies in Engineering Page 5

You might also like