0% found this document useful (0 votes)
30 views9 pages

Interaction Diagrams in UML

The document discusses interaction diagrams in UML. It describes the purpose of interaction diagrams as visualizing the interactive behavior of a system. Specifically, sequence diagrams capture the time sequence of message flows between objects, while collaboration diagrams describe the organization of objects. The document provides examples of a sequence diagram and collaboration diagram modeling an order management system to illustrate their usage. Interaction diagrams are used to understand message flow and structural organization in a system.

Uploaded by

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

Interaction Diagrams in UML

The document discusses interaction diagrams in UML. It describes the purpose of interaction diagrams as visualizing the interactive behavior of a system. Specifically, sequence diagrams capture the time sequence of message flows between objects, while collaboration diagrams describe the organization of objects. The document provides examples of a sequence diagram and collaboration diagram modeling an order management system to illustrate their usage. Interaction diagrams are used to understand message flow and structural organization in a system.

Uploaded by

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

Interaction

Diagrams in UML
Purpose of Interaction Diagrams
The purpose of interaction diagrams is to visualize the interactive behavior of the system. Visualizing the interaction is a
difficult task. Hence, the solution is to use different types of models to capture the different aspects of the interaction.

Sequence and collaboration diagrams are used to capture the dynamic nature but from a different angle.

The purpose of interaction diagram is −

To capture the dynamic behaviour of a system.

To describe the message flow in the system.

To describe the structural organization of the objects.

To describe the interaction among objects.


Interaction
Diagrams in UML
How to Draw an Interaction Diagram?
As we have already discussed, the purpose of interaction diagrams is to capture the
dynamic aspect of a system. So to capture the dynamic aspect, we need to understand
what a dynamic aspect is and how it is visualized. Dynamic aspect can be defined as the
snapshot of the running system at a particular moment
We have two types of interaction diagrams in UML. One is the sequence diagram and
the other is the collaboration diagram. The sequence diagram captures the time
sequence of the message flow from one object to another and the collaboration
diagram describes the organization of objects in a system taking part in the message
flow.
Interaction
Diagrams in UML
Following things are to be identified clearly before drawing the interaction diagram

Objects taking part in the interaction.

Message flows among the objects.

The sequence in which the messages are flowing.

Object organization.

Following are two interaction diagrams modeling the order management system. The first diagram is a
Interaction
Diagrams in UML
The Sequence Diagram
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 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.
Interaction
Diagrams in UML
Interaction
Diagrams in UML
The Collaboration Diagram
The second interaction diagram is the collaboration diagram. It 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.
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.
Interaction
Diagrams in UML
Interaction
Diagrams in UML
Where to Use Interaction Diagrams?
We have already discussed that interaction diagrams are used to describe the dynamic
nature of a system. Now, we will look into the practical scenarios where these diagrams
are used. To understand the practical application, we need to understand the basic
nature of sequence and collaboration diagram.

The main purpose of both the diagrams are similar as they are used to capture the
dynamic behavior of a system. However, the specific purpose is more important to
clarify and understand.
Interaction
Diagrams in UML
Sequence diagrams are used to capture the order of messages flowing from one object to another. Collaboration diagrams are used to
describe the structural organization of the objects taking part in the interaction. A single diagram is not sufficient to describe the
dynamic aspect of an entire system, so a set of diagrams are used to capture it as a whole.

Interaction diagrams are used when we want to understand the message flow and the structural organization. Message flow means the
sequence of control flow from one object to another. Structural organization means the visual organization of the elements in a system.

Interaction diagrams can be used −

To model the flow of control by time sequence.

To model the flow of control by structural organizations.

For forward engineering.

For reverse engineering.

You might also like