SlideShare a Scribd company logo
1 of 42
Download to read offline
Interaction Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
1
2
Interactions
 In every interesting system, objects don't just sit idle; they
interact with one another by passing messages.
 An interaction is a behavior that comprises a set of messages
exchanged among a set of objects within a context to accomplish
a purpose
 A message is a specification of a communication between objects
 Graphically, a message is rendered as a directed line and always
includes the name of its operation.
 You may find an interaction wherever objects are linked to one another.
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
3
Contents
 Objects and Roles
 Links
 Messages
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
4
Objects and Roles
 The objects that participate in an interaction are either concrete
things or prototypical things.
 As a concrete thing, an object represents something in the real
world. For example, p, an instance of the class Person, might
denote a particular human.
 Alternately, as a prototypical thing, p might represent any
instance of Person.
 In the context of an interaction, you may find instances of classes,
components, nodes, and use cases.
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
5
Messages
 In the UML, you can model several kinds of messages.
 A message is shown by an arrow from one lifeline to another.
 The arrowhead points to the receiver.
 If the message is synchronous (a call), the line has a filled
triangular arrowhead.
 If the message is asynchronous, the line has a stick arrowhead.
 A reply to a synchronous message (a return from a call) is
shown by a dashed arrow with a stick arrowhead.
 The return message may be omitted, as there is an implicit
return after any call, but it is often useful for showing return
values.
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
6
Messages
 In the UML, you can model several
kinds of messages.
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
7
Interaction Diagram
 An interaction diagram shows an interaction, consisting of a set
of objects and their relationships, including the messages that
may be dispatched among them.
 Sequence diagrams and collaboration diagrams - both are called
as interaction diagrams
 A sequence diagram is an interaction diagram that emphasizes the
time ordering of messages.
 Graphically, a sequence diagram is a table that shows objects arranged
along the X axis and messages, ordered in increasing time, along the Y
axis.
 A collaboration diagram is an interaction diagram that
emphasizes the structural organization of the objects that send
and receive messages.
 Graphically, a collaboration diagram is a collection of vertices and arcs.Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
8
Sequence Diagram
 A sequence diagram emphasizes the time ordering of messages.
 As below figure shows, you form a sequence diagram by first
placing the objects that participate in the interaction at the top of
your diagram, across the X axis.
 Typically, you place the object that initiates the interaction at the
left, and increasingly more subordinate objects to the right.
 Next, you place the messages that these objects send and receive
along the Y axis, in order of increasing time from top to bottom.
 Two important features,
 the object lifeline
 the focus of control
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
9
object lifeline
 An object lifeline is the vertical dashed line that represents the
existence of an object over a period of time.
 Most objects that appear in an interaction diagram will be in
existence for the duration of the interaction, so these objects are
all aligned at the top of the diagram, with their lifelines drawn
from the top of the diagram to the bottom.
 Objects may be created during the interaction.
 Their lifelines start with the receipt of the message stereotyped as create.
 Objects may be destroyed during the interaction.
 Their lifelines end with the receipt of the message stereotyped as destroy
(and are given the visual cue of a large X, marking the end of their lives).
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
10
object lifeline
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
11
focus of control
 The focus of control is a tall, thin rectangle that shows the period
of time during which an object is performing an action, either
directly or through a subordinate procedure.
 The top of the rectangle is aligned with the start of the action; the
bottom is aligned with its completion (and can be marked by a
return message).
 You can show the nesting of a focus of control (caused by
recursion, a call to a self-operation, or by a callback from another
object) by stacking another focus of control slightly to the right of
its parent (and can do so to an arbitrary depth).
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
12
focus of control
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
13
How to model Sequence Diagram
 Set the context for the interaction, whether it is a system,
subsystem, operation
 Set the stage for the interaction by identifying which objects play
a role in the interaction.
 Lay them out on the sequence diagram from left to right, placing the more
important objects to the left and their neighboring objects to the right.
 Set the lifeline for each object.
 For those objects that are created and destroyed during the interaction, set
their lifelines, as appropriate, and explicitly indicate their birth and death
with appropriately stereotyped messages.
 Starting with the message that initiates this interaction, lay out
each subsequent message from top to bottom between the
lifelines, showing each message's properties as necessary to
explain the semantics of the interaction.
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
14
Sequence Diagram 1
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
15
Sequence Diagram 1
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
16
Sequence Diagram 2
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
17
Sequence Diagram 3
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
18
Sequence Diagram 4
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
19
Sequence Diagram 5
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
20
Sequence Diagram 6
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
21
Sequence Diagram 6
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
22
Sequence Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
23
Sequence Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
24
Sequence Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
25
Sequence Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
26
Communication Diagram
 Sequence diagrams permit you to model the lifeline of an object.
 An object's lifeline represents the existence of the object at a
particular time.
 Collaboration diagrams permit you to model the structural links
that may exist among the objects in an interaction.
 It is also called as Collaboration Diagram
 A collaboration diagram is an interaction diagram that
emphasizes the structural organization of the objects that send
and receive messages.
 Collaboration diagram can be modelled by first placing the
objects that participate in the interaction as the vertices in a
graph.
 Next, you render the links that connect these objects as the arcs of
this graph.Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
27
How to model Communication Diagram
 Set the context for the interaction, it is a system, subsystem, operation?
 Set the stage for the interaction by identifying which objects play a role in
the interaction.
 Lay them out on the collaboration diagram as vertices in a graph, placing the
more important objects in the center of the diagram and their neighboring
objects to the outside.
 Specify the links among these objects, along which messages may pass
 Finally, you adorn these links with the messages that objects send and
receive.
 This gives the reader a clear visual cue to the flow of control in the context
of the structural organization of objects that collaborate.
 To indicate the time order of a message, you prefix the message with a
number (starting with the message numbered 1), increasing monotonically
for each new message in the flow of control (2, 3, and so on).
 To show nesting, you use Dewey decimal numbering (1 is the first message;
1.1 is the first message nested in message 1; 1.2 is the second message
nested in message 1; and so on).Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
28
Sequence Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
29
Communication Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
30
Semantic Equivalence
 Because they both derive from the same information in the UML's
metamodel, sequence diagrams and collaboration diagrams are
semantically equivalent.
 As a result, you can take a diagram in one form and convert it to the
other without any loss of information, as you can see in the previous
two figures, which are semantically equivalent.
 However, this does not mean that both diagrams will explicitly
visualize the same information.
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
31
Differences between diagrams
Sequence Diagrams Collaboration Diagrams
The sequence diagram represents the
UML, which is used to visualize the
sequence of calls in a system that is used
to perform a specific functionality.
The collaboration diagram also comes
under the UML representation which is
used to visualize the organization of the
objects and their interaction.
The sequence diagram are used to
represent the sequence of messages that
are flowing from one object to another.
The collaboration diagram are used to
represent the structural organization of
the system and the messages that are
sent and received.
The sequence diagram is used when
time sequence is main focus.
The collaboration dagram is used when
object organization is main focus.
The sequence diagrams are better suited
of analysis activities.
The collaboration diagrams are better
suited for depicting simpler interactions
of the smaller number of objects.
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
32
Sequence Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
33
Communication Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
34
Sequence Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
35
Communication Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
36
Sequence Diagram
Sequence Diagram for Patient Admit / Registration:-
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
37
Communication Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
38
Sequence Diagram
Sequence Diagram Test & Operation:-
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
39
Communication Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
40
Sequence Diagram
Sequence Diagram Discharge from Hospital
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
41
Communication Diagram
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
The End…
42
Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam

More Related Content

What's hot

Computer network switching
Computer network switchingComputer network switching
Computer network switchingShivani Godha
 
Introduction to Distributed System
Introduction to Distributed SystemIntroduction to Distributed System
Introduction to Distributed SystemSunita Sahu
 
Transaction management and concurrency control
Transaction management and concurrency controlTransaction management and concurrency control
Transaction management and concurrency controlDhani Ahmad
 
Agile development, software engineering
Agile development, software engineeringAgile development, software engineering
Agile development, software engineeringRupesh Vaishnav
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithmBushra M
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategiesSHREEHARI WADAWADAGI
 
Lecture 4 mobile database system
Lecture 4 mobile database systemLecture 4 mobile database system
Lecture 4 mobile database systemsalbiahhamzah
 
ELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOLELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOLShashank Rustagi
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management systemPooja Dixit
 
Real time and distributed design
Real time and distributed designReal time and distributed design
Real time and distributed designpriyapavi96
 
08 state diagram and activity diagram
08 state diagram and activity diagram08 state diagram and activity diagram
08 state diagram and activity diagramBaskarkncet
 
Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modelingramyaaswin
 
UML Architecture and Views
UML Architecture and ViewsUML Architecture and Views
UML Architecture and ViewsKumar
 

What's hot (20)

Computer network switching
Computer network switchingComputer network switching
Computer network switching
 
Introduction to Distributed System
Introduction to Distributed SystemIntroduction to Distributed System
Introduction to Distributed System
 
Taxonomy for bugs
Taxonomy for bugsTaxonomy for bugs
Taxonomy for bugs
 
Web controls
Web controlsWeb controls
Web controls
 
Transaction management and concurrency control
Transaction management and concurrency controlTransaction management and concurrency control
Transaction management and concurrency control
 
Distributed Operating System_1
Distributed Operating System_1Distributed Operating System_1
Distributed Operating System_1
 
Agile development, software engineering
Agile development, software engineeringAgile development, software engineering
Agile development, software engineering
 
Routing algorithm
Routing algorithmRouting algorithm
Routing algorithm
 
Chapter 13 software testing strategies
Chapter 13 software testing strategiesChapter 13 software testing strategies
Chapter 13 software testing strategies
 
Run time storage
Run time storageRun time storage
Run time storage
 
Lecture 4 mobile database system
Lecture 4 mobile database systemLecture 4 mobile database system
Lecture 4 mobile database system
 
ELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOLELEMENTS OF TRANSPORT PROTOCOL
ELEMENTS OF TRANSPORT PROTOCOL
 
Distributed database management system
Distributed database management  systemDistributed database management  system
Distributed database management system
 
Network software
Network softwareNetwork software
Network software
 
Real time and distributed design
Real time and distributed designReal time and distributed design
Real time and distributed design
 
08 state diagram and activity diagram
08 state diagram and activity diagram08 state diagram and activity diagram
08 state diagram and activity diagram
 
serializability in dbms
serializability in dbmsserializability in dbms
serializability in dbms
 
Introduction to UML
Introduction to UMLIntroduction to UML
Introduction to UML
 
Flow oriented modeling
Flow oriented modelingFlow oriented modeling
Flow oriented modeling
 
UML Architecture and Views
UML Architecture and ViewsUML Architecture and Views
UML Architecture and Views
 

Similar to OOAD - UML - Sequence and Communication Diagrams - Lab

UML-Advanced Software Engineering
UML-Advanced Software EngineeringUML-Advanced Software Engineering
UML-Advanced Software EngineeringAmit Singh
 
UML, ER and Dimensional Modelling
UML, ER and Dimensional ModellingUML, ER and Dimensional Modelling
UML, ER and Dimensional ModellingStefano Dalla Palma
 
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGNOOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGNKalyaniLokhande5
 
S W L Chapter 5
S W L  Chapter 5S W L  Chapter 5
S W L Chapter 5dmhall
 
S W L Chapter 5
S W L  Chapter 5S W L  Chapter 5
S W L Chapter 5dmhall
 
SWL Chapter 5
SWL Chapter 5SWL Chapter 5
SWL Chapter 5dmhall
 
ITP251 SWL 5
ITP251 SWL 5ITP251 SWL 5
ITP251 SWL 5dmhall
 
SWL Chapter 5
SWL Chapter 5SWL Chapter 5
SWL Chapter 5dmhall
 
SWL Chapter 5
SWL Chapter 5SWL Chapter 5
SWL Chapter 5dmhall
 
Coates p: 1999 agent based modelling
Coates p: 1999 agent based modellingCoates p: 1999 agent based modelling
Coates p: 1999 agent based modellingArchiLab 7
 
Adaptive named entity recognition for social network analysis and domain onto...
Adaptive named entity recognition for social network analysis and domain onto...Adaptive named entity recognition for social network analysis and domain onto...
Adaptive named entity recognition for social network analysis and domain onto...Cuong Tran Van
 
AI assagnmebt.docx
AI assagnmebt.docxAI assagnmebt.docx
AI assagnmebt.docxHelinayen
 
Intro to UML 2
Intro to UML 2Intro to UML 2
Intro to UML 2rchakra
 
Lloyd Swarmfest 2010 Presentation
Lloyd   Swarmfest 2010 PresentationLloyd   Swarmfest 2010 Presentation
Lloyd Swarmfest 2010 Presentationkalloyd
 

Similar to OOAD - UML - Sequence and Communication Diagrams - Lab (20)

UML-Advanced Software Engineering
UML-Advanced Software EngineeringUML-Advanced Software Engineering
UML-Advanced Software Engineering
 
Sequence Diagram
Sequence Diagram Sequence Diagram
Sequence Diagram
 
Sequence Diagram
Sequence Diagram Sequence Diagram
Sequence Diagram
 
UML, ER and Dimensional Modelling
UML, ER and Dimensional ModellingUML, ER and Dimensional Modelling
UML, ER and Dimensional Modelling
 
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGNOOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
OOAD-Unit-3.ppt UML and ANALYSISI AND DESIGN
 
S W L Chapter 5
S W L  Chapter 5S W L  Chapter 5
S W L Chapter 5
 
S W L Chapter 5
S W L  Chapter 5S W L  Chapter 5
S W L Chapter 5
 
SWL Chapter 5
SWL Chapter 5SWL Chapter 5
SWL Chapter 5
 
ITP251 SWL 5
ITP251 SWL 5ITP251 SWL 5
ITP251 SWL 5
 
SWL Chapter 5
SWL Chapter 5SWL Chapter 5
SWL Chapter 5
 
SWL Chapter 5
SWL Chapter 5SWL Chapter 5
SWL Chapter 5
 
Coates p: 1999 agent based modelling
Coates p: 1999 agent based modellingCoates p: 1999 agent based modelling
Coates p: 1999 agent based modelling
 
Cs8592 ooad unit 3
Cs8592 ooad unit 3Cs8592 ooad unit 3
Cs8592 ooad unit 3
 
Cs8592 ooad unit 3
Cs8592 ooad unit 3Cs8592 ooad unit 3
Cs8592 ooad unit 3
 
Adaptive named entity recognition for social network analysis and domain onto...
Adaptive named entity recognition for social network analysis and domain onto...Adaptive named entity recognition for social network analysis and domain onto...
Adaptive named entity recognition for social network analysis and domain onto...
 
AI assagnmebt.docx
AI assagnmebt.docxAI assagnmebt.docx
AI assagnmebt.docx
 
Chapter7
Chapter7Chapter7
Chapter7
 
Intro to UML 2
Intro to UML 2Intro to UML 2
Intro to UML 2
 
Informatics systems
Informatics systemsInformatics systems
Informatics systems
 
Lloyd Swarmfest 2010 Presentation
Lloyd   Swarmfest 2010 PresentationLloyd   Swarmfest 2010 Presentation
Lloyd Swarmfest 2010 Presentation
 

More from Victer Paul

OOAD - UML - Class and Object Diagrams - Lab
OOAD - UML - Class and Object Diagrams - LabOOAD - UML - Class and Object Diagrams - Lab
OOAD - UML - Class and Object Diagrams - LabVicter Paul
 
OOAD - Systems and Object Orientation Concepts
OOAD - Systems and Object Orientation ConceptsOOAD - Systems and Object Orientation Concepts
OOAD - Systems and Object Orientation ConceptsVicter Paul
 
Java - Strings Concepts
Java - Strings ConceptsJava - Strings Concepts
Java - Strings ConceptsVicter Paul
 
Java - Packages Concepts
Java - Packages ConceptsJava - Packages Concepts
Java - Packages ConceptsVicter Paul
 
Java - OOPS and Java Basics
Java - OOPS and Java BasicsJava - OOPS and Java Basics
Java - OOPS and Java BasicsVicter Paul
 
Java - Exception Handling Concepts
Java - Exception Handling ConceptsJava - Exception Handling Concepts
Java - Exception Handling ConceptsVicter Paul
 
Java - Class Structure
Java - Class StructureJava - Class Structure
Java - Class StructureVicter Paul
 
Java - Object Oriented Programming Concepts
Java - Object Oriented Programming ConceptsJava - Object Oriented Programming Concepts
Java - Object Oriented Programming ConceptsVicter Paul
 
Java - Basic Concepts
Java - Basic ConceptsJava - Basic Concepts
Java - Basic ConceptsVicter Paul
 
Java - File Input Output Concepts
Java - File Input Output ConceptsJava - File Input Output Concepts
Java - File Input Output ConceptsVicter Paul
 
Java - Inheritance Concepts
Java - Inheritance ConceptsJava - Inheritance Concepts
Java - Inheritance ConceptsVicter Paul
 
Java - Arrays Concepts
Java - Arrays ConceptsJava - Arrays Concepts
Java - Arrays ConceptsVicter Paul
 
Java applet programming concepts
Java  applet programming conceptsJava  applet programming concepts
Java applet programming conceptsVicter Paul
 

More from Victer Paul (13)

OOAD - UML - Class and Object Diagrams - Lab
OOAD - UML - Class and Object Diagrams - LabOOAD - UML - Class and Object Diagrams - Lab
OOAD - UML - Class and Object Diagrams - Lab
 
OOAD - Systems and Object Orientation Concepts
OOAD - Systems and Object Orientation ConceptsOOAD - Systems and Object Orientation Concepts
OOAD - Systems and Object Orientation Concepts
 
Java - Strings Concepts
Java - Strings ConceptsJava - Strings Concepts
Java - Strings Concepts
 
Java - Packages Concepts
Java - Packages ConceptsJava - Packages Concepts
Java - Packages Concepts
 
Java - OOPS and Java Basics
Java - OOPS and Java BasicsJava - OOPS and Java Basics
Java - OOPS and Java Basics
 
Java - Exception Handling Concepts
Java - Exception Handling ConceptsJava - Exception Handling Concepts
Java - Exception Handling Concepts
 
Java - Class Structure
Java - Class StructureJava - Class Structure
Java - Class Structure
 
Java - Object Oriented Programming Concepts
Java - Object Oriented Programming ConceptsJava - Object Oriented Programming Concepts
Java - Object Oriented Programming Concepts
 
Java - Basic Concepts
Java - Basic ConceptsJava - Basic Concepts
Java - Basic Concepts
 
Java - File Input Output Concepts
Java - File Input Output ConceptsJava - File Input Output Concepts
Java - File Input Output Concepts
 
Java - Inheritance Concepts
Java - Inheritance ConceptsJava - Inheritance Concepts
Java - Inheritance Concepts
 
Java - Arrays Concepts
Java - Arrays ConceptsJava - Arrays Concepts
Java - Arrays Concepts
 
Java applet programming concepts
Java  applet programming conceptsJava  applet programming concepts
Java applet programming concepts
 

Recently uploaded

Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueBhangaleSonal
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdfKamal Acharya
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdfKamal Acharya
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startQuintin Balsdon
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilVinayVitekari
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...HenryBriggs2
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfJiananWang21
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"mphochane1998
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityMorshed Ahmed Rahath
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Ramkumar k
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksMagic Marks
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptxJIT KUMAR GUPTA
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfsumitt6_25730773
 

Recently uploaded (20)

Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
scipt v1.pptxcxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx...
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)Theory of Time 2024 (Universal Theory for Everything)
Theory of Time 2024 (Universal Theory for Everything)
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
Learn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic MarksLearn the concepts of Thermodynamics on Magic Marks
Learn the concepts of Thermodynamics on Magic Marks
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Introduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdfIntroduction to Data Visualization,Matplotlib.pdf
Introduction to Data Visualization,Matplotlib.pdf
 

OOAD - UML - Sequence and Communication Diagrams - Lab

  • 1. Interaction Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam 1
  • 2. 2 Interactions  In every interesting system, objects don't just sit idle; they interact with one another by passing messages.  An interaction is a behavior that comprises a set of messages exchanged among a set of objects within a context to accomplish a purpose  A message is a specification of a communication between objects  Graphically, a message is rendered as a directed line and always includes the name of its operation.  You may find an interaction wherever objects are linked to one another. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 3. 3 Contents  Objects and Roles  Links  Messages Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 4. 4 Objects and Roles  The objects that participate in an interaction are either concrete things or prototypical things.  As a concrete thing, an object represents something in the real world. For example, p, an instance of the class Person, might denote a particular human.  Alternately, as a prototypical thing, p might represent any instance of Person.  In the context of an interaction, you may find instances of classes, components, nodes, and use cases. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 5. 5 Messages  In the UML, you can model several kinds of messages.  A message is shown by an arrow from one lifeline to another.  The arrowhead points to the receiver.  If the message is synchronous (a call), the line has a filled triangular arrowhead.  If the message is asynchronous, the line has a stick arrowhead.  A reply to a synchronous message (a return from a call) is shown by a dashed arrow with a stick arrowhead.  The return message may be omitted, as there is an implicit return after any call, but it is often useful for showing return values. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 6. 6 Messages  In the UML, you can model several kinds of messages. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 7. 7 Interaction Diagram  An interaction diagram shows an interaction, consisting of a set of objects and their relationships, including the messages that may be dispatched among them.  Sequence diagrams and collaboration diagrams - both are called as interaction diagrams  A sequence diagram is an interaction diagram that emphasizes the time ordering of messages.  Graphically, a sequence diagram is a table that shows objects arranged along the X axis and messages, ordered in increasing time, along the Y axis.  A collaboration diagram is an interaction diagram that emphasizes the structural organization of the objects that send and receive messages.  Graphically, a collaboration diagram is a collection of vertices and arcs.Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 8. 8 Sequence Diagram  A sequence diagram emphasizes the time ordering of messages.  As below figure shows, you form a sequence diagram by first placing the objects that participate in the interaction at the top of your diagram, across the X axis.  Typically, you place the object that initiates the interaction at the left, and increasingly more subordinate objects to the right.  Next, you place the messages that these objects send and receive along the Y axis, in order of increasing time from top to bottom.  Two important features,  the object lifeline  the focus of control Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 9. 9 object lifeline  An object lifeline is the vertical dashed line that represents the existence of an object over a period of time.  Most objects that appear in an interaction diagram will be in existence for the duration of the interaction, so these objects are all aligned at the top of the diagram, with their lifelines drawn from the top of the diagram to the bottom.  Objects may be created during the interaction.  Their lifelines start with the receipt of the message stereotyped as create.  Objects may be destroyed during the interaction.  Their lifelines end with the receipt of the message stereotyped as destroy (and are given the visual cue of a large X, marking the end of their lives). Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 10. 10 object lifeline Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 11. 11 focus of control  The focus of control is a tall, thin rectangle that shows the period of time during which an object is performing an action, either directly or through a subordinate procedure.  The top of the rectangle is aligned with the start of the action; the bottom is aligned with its completion (and can be marked by a return message).  You can show the nesting of a focus of control (caused by recursion, a call to a self-operation, or by a callback from another object) by stacking another focus of control slightly to the right of its parent (and can do so to an arbitrary depth). Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 12. 12 focus of control Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 13. 13 How to model Sequence Diagram  Set the context for the interaction, whether it is a system, subsystem, operation  Set the stage for the interaction by identifying which objects play a role in the interaction.  Lay them out on the sequence diagram from left to right, placing the more important objects to the left and their neighboring objects to the right.  Set the lifeline for each object.  For those objects that are created and destroyed during the interaction, set their lifelines, as appropriate, and explicitly indicate their birth and death with appropriately stereotyped messages.  Starting with the message that initiates this interaction, lay out each subsequent message from top to bottom between the lifelines, showing each message's properties as necessary to explain the semantics of the interaction. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 14. 14 Sequence Diagram 1 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 15. 15 Sequence Diagram 1 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 16. 16 Sequence Diagram 2 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 17. 17 Sequence Diagram 3 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 18. 18 Sequence Diagram 4 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 19. 19 Sequence Diagram 5 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 20. 20 Sequence Diagram 6 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 21. 21 Sequence Diagram 6 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 22. 22 Sequence Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 23. 23 Sequence Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 24. 24 Sequence Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 25. 25 Sequence Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 26. 26 Communication Diagram  Sequence diagrams permit you to model the lifeline of an object.  An object's lifeline represents the existence of the object at a particular time.  Collaboration diagrams permit you to model the structural links that may exist among the objects in an interaction.  It is also called as Collaboration Diagram  A collaboration diagram is an interaction diagram that emphasizes the structural organization of the objects that send and receive messages.  Collaboration diagram can be modelled by first placing the objects that participate in the interaction as the vertices in a graph.  Next, you render the links that connect these objects as the arcs of this graph.Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 27. 27 How to model Communication Diagram  Set the context for the interaction, it is a system, subsystem, operation?  Set the stage for the interaction by identifying which objects play a role in the interaction.  Lay them out on the collaboration diagram as vertices in a graph, placing the more important objects in the center of the diagram and their neighboring objects to the outside.  Specify the links among these objects, along which messages may pass  Finally, you adorn these links with the messages that objects send and receive.  This gives the reader a clear visual cue to the flow of control in the context of the structural organization of objects that collaborate.  To indicate the time order of a message, you prefix the message with a number (starting with the message numbered 1), increasing monotonically for each new message in the flow of control (2, 3, and so on).  To show nesting, you use Dewey decimal numbering (1 is the first message; 1.1 is the first message nested in message 1; 1.2 is the second message nested in message 1; and so on).Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 28. 28 Sequence Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 29. 29 Communication Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 30. 30 Semantic Equivalence  Because they both derive from the same information in the UML's metamodel, sequence diagrams and collaboration diagrams are semantically equivalent.  As a result, you can take a diagram in one form and convert it to the other without any loss of information, as you can see in the previous two figures, which are semantically equivalent.  However, this does not mean that both diagrams will explicitly visualize the same information. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 31. 31 Differences between diagrams Sequence Diagrams Collaboration Diagrams The sequence diagram represents the UML, which is used to visualize the sequence of calls in a system that is used to perform a specific functionality. The collaboration diagram also comes under the UML representation which is used to visualize the organization of the objects and their interaction. The sequence diagram are used to represent the sequence of messages that are flowing from one object to another. The collaboration diagram are used to represent the structural organization of the system and the messages that are sent and received. The sequence diagram is used when time sequence is main focus. The collaboration dagram is used when object organization is main focus. The sequence diagrams are better suited of analysis activities. The collaboration diagrams are better suited for depicting simpler interactions of the smaller number of objects. Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 32. 32 Sequence Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 33. 33 Communication Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 34. 34 Sequence Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 35. 35 Communication Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 36. 36 Sequence Diagram Sequence Diagram for Patient Admit / Registration:- Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 37. 37 Communication Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 38. 38 Sequence Diagram Sequence Diagram Test & Operation:- Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 39. 39 Communication Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 40. 40 Sequence Diagram Sequence Diagram Discharge from Hospital Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 41. 41 Communication Diagram Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam
  • 42. The End… 42 Dr. P. Victer Paul, Indian Institute of Information Technology Kottayam