Documente Academic
Documente Profesional
Documente Cultură
Language ( UML )
Communication Diagrams( Or
Collaboration Diagrams)
What is a Communication Diagram
Communication diagram (called
•
arrangement
What is a Collaboration
•A Collaboration is a collection of named objects
and actors with links connecting them as they
collaborate in performing some task
•A Collaboration defines a set of participants and
system
•Capture interactions that show the passed messages
5
Why Use Collaboration Diagram when
opposed to Sequence Diagrams
▪ First of all, they are very useful for visualizing the relationship
between objects collaborating to perform a particular task
which is difficult to determine from a sequence diagram
▪ In addition, collaboration diagrams can also help us determine
the accuracy of our static model (i.e., class diagrams)
▪ Some developers take the step of creating static models of
their business objects, but don't "prove" their models by
creating associated dynamic models
▪ Once we put our classes into action (or interaction), we can
often see flaws in our static model that may not have been 6
discovered otherwise
Sequence Diagrams Vs Collaboration
Diagrams
•Sequence and collaboration diagrams
both aim at describing the dynamic
interactions between objects and the
information we can describe is basically
the same, but the two models have a
different focus
7
Sequence Diagrams Vs
Collaboration Diagrams
•Sequence diagrams highlight more the temporal aspect, by
showing invocation and responses along a (vertical) timeline
and by explicitly showing the activation time of objects
•Sequence diagrams show how objects communicate with
9
Sequence Diagrams Vs
Collaboration Diagrams
•Collaboration diagrams aim at showing the
communications that happen between objects,
by defining messages that flow between each
other
•They basically consist of superimposing the
12
13
14
Steps for Creating Collaboration
Diagrams
▪ Identify behavior whose realization and implementation is specified
▪ Identify the structural elements (class roles, objects, subsystems)
necessary to carry out the functionality of the collaboration
▫ Decide on the context of interaction: system, subsystem, use
case and operation
▪ Model structural relationships between those elements to produce a
diagram showing the context of the interaction
▪ Consider the alternative scenarios that may be required
▫ Draw instance level collaboration diagrams, if required.
▫ Optionally draw a specification level collaboration diagram to
summarize the alternative scenarios in the instance level 15
sequence diagrams
Communication Diagram:
Basic Notations
16
Objects
•Objects participating in a collaboration
come in two flavors : supplier and client
•Supplier objects are the objects that
objects
•This is different from sequence diagrams, where the lines drawn
19
between objects represent messages sent from one object to
another
As you can see by looking at Figure 2, the visual representation of a link is a straight
line between two objects. If an object sends messages to itself, the link carrying these
messages is represented as a loop icon. This loop can be seen on both the UI object 20
and the Transaction object.
Links( contd…)
•Links in a collaboration diagram directly correlate
to associations between classes in a class diagram
•For example, an association between the
22
23
Case Scenario : Local software
Update
•Communication diagram for a software update
process having three objects – Software Update,
Local Update and Install
•Software update object gets triggered when there is
available
If local updates are available Install object instance is
24
created and update is installed
25
In a NUTSHELL
Communication diagram are used to
represent links between objects
They help us to understand how objects
interact with each other in a System
26
Case Scenario : Login Process of
Student Management System
▪ The flow of communication required is given by,
▪ A student requests a login through the login
system
▪ An authentication mechanism of software
checks the request
▪ If a student entry exists in the database, then
the access is allowed; otherwise, an error is 27
returned
28
Benefits of a Collaboration Diagram
▪ It emphasizes the structural aspects of an interaction diagram - how
lifeline connects and has a syntax similar to that of sequence diagram
except that lifeline don't have tails
▪ Messages passed over sequencing is indicated by numbering each
message hierarchically and as compared to the sequence diagram
communication diagram is semantically weak
▪ Object diagrams are special case of communication diagram
▪ It allows us to focus on the elements rather than focusing on the
message flow as described in the sequence diagram
▪ Sequence diagrams can be easily converted into a collaboration
diagram as collaboration diagrams are not very expressive
29
▪ While modeling collaboration diagrams with respect to sequence
diagrams, some information may be lost
Drawbacks of a Collaboration Diagram
▪ Collaboration diagrams can become complex when
too many objects are present within the system.
▪ It is hard to explore each object inside the system.
▪ Collaboration diagrams are time consuming.
▪ The object is destroyed after the termination of a
program.
▪ The state of an object changes momentarily, which
makes it difficult to keep track of every single 30
change the occurs within an object of a system.
THANK YOU