SlideShare ist ein Scribd-Unternehmen logo
1 von 42
Downloaden Sie, um offline zu lesen
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

Weitere ähnliche Inhalte

Was ist angesagt?

Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12
koolkampus
 
Logical Clocks (Distributed computing)
Logical Clocks (Distributed computing)Logical Clocks (Distributed computing)
Logical Clocks (Distributed computing)
Sri Prasanna
 
World wide web architecture presentation
World wide web architecture presentationWorld wide web architecture presentation
World wide web architecture presentation
ImMe Khan
 
Asp .net web form fundamentals
Asp .net web form fundamentalsAsp .net web form fundamentals
Asp .net web form fundamentals
Gopal Ji Singh
 
02. chapter 3 lexical analysis
02. chapter 3   lexical analysis02. chapter 3   lexical analysis
02. chapter 3 lexical analysis
raosir123
 

Was ist angesagt? (20)

Object Oriented Programming Languages
Object Oriented Programming LanguagesObject Oriented Programming Languages
Object Oriented Programming Languages
 
Object diagram
Object diagramObject diagram
Object diagram
 
Chapter 5 Syntax Directed Translation
Chapter 5   Syntax Directed TranslationChapter 5   Syntax Directed Translation
Chapter 5 Syntax Directed Translation
 
Java Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPRECJava Notes by C. Sreedhar, GPREC
Java Notes by C. Sreedhar, GPREC
 
Introduction to oops concepts
Introduction to oops conceptsIntroduction to oops concepts
Introduction to oops concepts
 
Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12Object Oriented Design in Software Engineering SE12
Object Oriented Design in Software Engineering SE12
 
Use case Diagram and Sequence Diagram
Use case Diagram and Sequence DiagramUse case Diagram and Sequence Diagram
Use case Diagram and Sequence Diagram
 
Logical Clocks (Distributed computing)
Logical Clocks (Distributed computing)Logical Clocks (Distributed computing)
Logical Clocks (Distributed computing)
 
Object Oriented Programming
Object Oriented ProgrammingObject Oriented Programming
Object Oriented Programming
 
World wide web architecture presentation
World wide web architecture presentationWorld wide web architecture presentation
World wide web architecture presentation
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
 
Network Layer design Issues.pptx
Network Layer design Issues.pptxNetwork Layer design Issues.pptx
Network Layer design Issues.pptx
 
Asp .net web form fundamentals
Asp .net web form fundamentalsAsp .net web form fundamentals
Asp .net web form fundamentals
 
Petri Nets: Properties, Analysis and Applications
Petri Nets: Properties, Analysis and ApplicationsPetri Nets: Properties, Analysis and Applications
Petri Nets: Properties, Analysis and Applications
 
Character generation techniques
Character generation techniquesCharacter generation techniques
Character generation techniques
 
Block Cipher and its Design Principles
Block Cipher and its Design PrinciplesBlock Cipher and its Design Principles
Block Cipher and its Design Principles
 
Data Designs (Software Engg.)
Data Designs (Software Engg.)Data Designs (Software Engg.)
Data Designs (Software Engg.)
 
Language for specifying lexical Analyzer
Language for specifying lexical AnalyzerLanguage for specifying lexical Analyzer
Language for specifying lexical Analyzer
 
02. chapter 3 lexical analysis
02. chapter 3   lexical analysis02. chapter 3   lexical analysis
02. chapter 3 lexical analysis
 
Communication primitives
Communication primitivesCommunication primitives
Communication primitives
 

Ähnlich wie OOAD - UML - Sequence and Communication Diagrams - Lab

UML-Advanced Software Engineering
UML-Advanced Software EngineeringUML-Advanced Software Engineering
UML-Advanced Software Engineering
Amit Singh
 
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
KalyaniLokhande5
 
S W L Chapter 5
S W L  Chapter 5S W L  Chapter 5
S W L Chapter 5
dmhall
 
S W L Chapter 5
S W L  Chapter 5S W L  Chapter 5
S W L Chapter 5
dmhall
 
Coates p: 1999 agent based modelling
Coates p: 1999 agent based modellingCoates p: 1999 agent based modelling
Coates p: 1999 agent based modelling
ArchiLab 7
 

Ähnlich wie 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
 

Mehr von 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
 

Kürzlich hochgeladen

Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
chumtiyababu
 
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
Epec Engineered Technologies
 
"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
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
Kamal Acharya
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 

Kürzlich hochgeladen (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
 
Verification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptxVerification of thevenin's theorem for BEEE Lab (1).pptx
Verification of thevenin's theorem for BEEE Lab (1).pptx
 
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
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Thermal Engineering Unit - I & II . ppt
Thermal Engineering  Unit - I & II . pptThermal Engineering  Unit - I & II . ppt
Thermal Engineering Unit - I & II . ppt
 
"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"
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLEGEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
GEAR TRAIN- BASIC CONCEPTS AND WORKING PRINCIPLE
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
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
 
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKARHAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
HAND TOOLS USED AT ELECTRONICS WORK PRESENTED BY KOUSTAV SARKAR
 
Hospital management system project report.pdf
Hospital management system project report.pdfHospital management system project report.pdf
Hospital management system project report.pdf
 
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 

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