Duration: 3hrs
1
Ramakant Soni
Assistant Professor
Dept. of Computer Science
B K Birla Institute of Engineering & Technology, Pilani, India
Ramakant Soni @ BKBIET Pilani
Collaboration Diagram Definition
Collaboration Diagrams captures dynamic behavior of
the objects in the system (message-oriented).
They are very useful for visualizing the relationship
between objects collaborating to perform a particular
task.
Ramakant Soni @ BKBIET Pilani 2
Their purpose is to:
Model flow of control
Illustrate coordination of object structure and control
Collaboration Diagram Elements
There are three primary elements of a collaboration
diagram:
1. Objects
2. Links
3. Messages
Ramakant Soni @ BKBIET Pilani 3
3. Messages
What it represents?
Collaboration Diagrams illustrate object interactions in a graph or
network format.
Ramakant Soni @ BKBIET Pilani 4
Notations used for Collaboration Diagrams
 To show an instance of a class, the
regular class box graphic symbol is
used, but the name is underlined.
Additionally a class name should be
preceded by a colon.
Ramakant Soni @ BKBIET Pilani 5
 An instance name can be used to
uniquely identify the instance.
Links, Messages and Return Value
Ramakant Soni @ BKBIET Pilani 6
“Self” Messages
 A message can be sent from an object to itself.
 This is illustrated by a link to itself, with messages flowing along the link.
Ramakant Soni @ BKBIET Pilani 7
Conditional Messages
 A conditional message is shown by following a sequence number with
a conditional clause in square brackets, similar to the iteration clause.
 The message is sent only if the clause evaluates to true.
Ramakant Soni @ BKBIET Pilani 8
Iteration or Looping
 Iteration is indicated by following the
sequence number with a star( * ).
 This expresses that the message is being
sent repeatedly, in a loop, to the
Ramakant Soni @ BKBIET Pilani 9
sent repeatedly, in a loop, to the
receiver.
 It is also possible to include an iteration
clause indicating the recurrence values.
Representing Collections (Multiobject)
 A multiobject is a set of instances.
Ramakant Soni @ BKBIET Pilani 10
EX1: Collaboration Diagram
Ramakant Soni @ BKBIET Pilani 11
Class diagram for : Make a phone call
EX1: Sequence to Collaboration Diagram
Ramakant Soni @ BKBIET Pilani 12
Process for : Make a phone call
EX1: Sequence to Collaboration Diagram
Ramakant Soni @ BKBIET Pilani 13
Collaboration diagram for : Make a phone call
EX2: Sequence to Collaboration Diagram
Ramakant Soni @ BKBIET Pilani 14
Sequence diagram for : change Airline itineraries
EX2: Sequence to Collaboration Diagram
Ramakant Soni @ BKBIET Pilani 15
Collaboration diagram for : change Airline itineraries
EX3: Sequence to Collaboration Diagram
Ramakant Soni @ BKBIET Pilani 16
Sequence diagram for : hotel reservation
EX3: Sequence to Collaboration Diagram
Ramakant Soni @ BKBIET Pilani 17
Collaboration diagram for : hotel reservation
References:
[1] http://www.uml-diagrams.org/
[2] http://en.wikipedia.org/wiki/Collaboration_diagram
[3] http://www.uml-diagrams.org/Collaboration-diagrams-examples.html
Ramakant Soni @ BKBIET Pilani 18
ThanksThanks
18

Collaboration diagram- UML diagram

  • 1.
    Duration: 3hrs 1 Ramakant Soni AssistantProfessor Dept. of Computer Science B K Birla Institute of Engineering & Technology, Pilani, India Ramakant Soni @ BKBIET Pilani
  • 2.
    Collaboration Diagram Definition CollaborationDiagrams captures dynamic behavior of the objects in the system (message-oriented). They are very useful for visualizing the relationship between objects collaborating to perform a particular task. Ramakant Soni @ BKBIET Pilani 2 Their purpose is to: Model flow of control Illustrate coordination of object structure and control
  • 3.
    Collaboration Diagram Elements Thereare three primary elements of a collaboration diagram: 1. Objects 2. Links 3. Messages Ramakant Soni @ BKBIET Pilani 3 3. Messages
  • 4.
    What it represents? CollaborationDiagrams illustrate object interactions in a graph or network format. Ramakant Soni @ BKBIET Pilani 4
  • 5.
    Notations used forCollaboration Diagrams  To show an instance of a class, the regular class box graphic symbol is used, but the name is underlined. Additionally a class name should be preceded by a colon. Ramakant Soni @ BKBIET Pilani 5  An instance name can be used to uniquely identify the instance.
  • 6.
    Links, Messages andReturn Value Ramakant Soni @ BKBIET Pilani 6
  • 7.
    “Self” Messages  Amessage can be sent from an object to itself.  This is illustrated by a link to itself, with messages flowing along the link. Ramakant Soni @ BKBIET Pilani 7
  • 8.
    Conditional Messages  Aconditional message is shown by following a sequence number with a conditional clause in square brackets, similar to the iteration clause.  The message is sent only if the clause evaluates to true. Ramakant Soni @ BKBIET Pilani 8
  • 9.
    Iteration or Looping Iteration is indicated by following the sequence number with a star( * ).  This expresses that the message is being sent repeatedly, in a loop, to the Ramakant Soni @ BKBIET Pilani 9 sent repeatedly, in a loop, to the receiver.  It is also possible to include an iteration clause indicating the recurrence values.
  • 10.
    Representing Collections (Multiobject) A multiobject is a set of instances. Ramakant Soni @ BKBIET Pilani 10
  • 11.
    EX1: Collaboration Diagram RamakantSoni @ BKBIET Pilani 11 Class diagram for : Make a phone call
  • 12.
    EX1: Sequence toCollaboration Diagram Ramakant Soni @ BKBIET Pilani 12 Process for : Make a phone call
  • 13.
    EX1: Sequence toCollaboration Diagram Ramakant Soni @ BKBIET Pilani 13 Collaboration diagram for : Make a phone call
  • 14.
    EX2: Sequence toCollaboration Diagram Ramakant Soni @ BKBIET Pilani 14 Sequence diagram for : change Airline itineraries
  • 15.
    EX2: Sequence toCollaboration Diagram Ramakant Soni @ BKBIET Pilani 15 Collaboration diagram for : change Airline itineraries
  • 16.
    EX3: Sequence toCollaboration Diagram Ramakant Soni @ BKBIET Pilani 16 Sequence diagram for : hotel reservation
  • 17.
    EX3: Sequence toCollaboration Diagram Ramakant Soni @ BKBIET Pilani 17 Collaboration diagram for : hotel reservation
  • 18.
    References: [1] http://www.uml-diagrams.org/ [2] http://en.wikipedia.org/wiki/Collaboration_diagram [3]http://www.uml-diagrams.org/Collaboration-diagrams-examples.html Ramakant Soni @ BKBIET Pilani 18 ThanksThanks 18