differences between sequence diagram and collaboration diagram
Asked Answered
Y

6

19

As i read through UML specification superstructure that there is sequence diagram and there is a collaboration diagram so,What is the differences between

sequence diagram and collaboration diagram?

Yb answered 14/1, 2013 at 13:10 Comment(2)
possible duplicate of What is the difference between sequence diagram and communication diagram?Wapiti
sequence diagrams describe successful behaviourChapen
L
21

Sequence and collaboration diagrams both aim at describing the dynamic interactions between objects. The information you can describe are basically the same, but the two models have a different focus:

  • 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 each other in terms of a temporal sequence of messages. The time flow is the most visible aspect in these diagrams, as messages are sequenced according to a vertical timeline and also the lifespan of objects associated to those messages is reported. The figure below (taken from our book) shows an example of a sequence diagram describing 3 objects (instances of classes Shipment, Invoice and PartList) and the messages exchanged between each other. Interaction diagrams describe execution scenarios of the system.

UML sequence diagram example

  • 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 communication actions upon an object diagram. The temporal aspect can be shown here too, by numbering the interactions with sequential labels. A collaboration diagram shows the interactions between objects or classes in terms of links (solid undirected lines connecting the elements that can interact) and messages that flow through the links. This describes at the same time some kind of static structure (links and nodes) and dynamic behavior (messages) of the system. An example is shown below.

UML collaboration diagram example

Lema answered 28/1, 2013 at 16:11 Comment(2)
thank you for your efforts. To the best of my knowledge,the second figure is communication diagram not collaboration,isn't it? because i read about collaboration in UML specification superstructure 2.5 still beta ,page 225 omg.org/spec/UML/2.5/Beta1/PDFYb
uh.. well, it's actually a collaboration diagram in UML 1 (and thus a sort of communication diagram in UML 2). Since you were asking now, I assumed you were asking about past models.Babu
P
5

UML1: These diagrams are the same, but present data from different points of view.

UML2: The Collaboration diagram is renamed to Communication diagram (there were misunderstanding since people thought that Collaboration diagram was used to show collaborations). These diagrams are almost the same, but present the Sequence diagram has much more possibilities for visualization (for example, combined fragments, state invariants).

Prolactin answered 14/1, 2013 at 15:7 Comment(0)
R
4

Sequence diagrams specify interaction in a time sequence manner which may be among objects and/or classes. These diagrams are created during early elaboration phase where each flow of the use case is defined in terms of sequences , i.e. after each step what is going to happen next. This kind of representation is very helpful to understand & discuss the use cases with the customer, where both can come out with all possible functional aspects. On the other hand collaboration diagram provides a direct interaction among the object. These diagram seem to used more in the design phase of the development when you are designing the implementation of the relationship.

Ratfink answered 29/9, 2013 at 12:27 Comment(0)
G
2

There is a difference between sequence diagrams and collaboration diagrams. Sequence diagrams shows object interaction in timely manner(so no need of numbering the messages). But collaboration diagram doesn't show object interaction in timely manner. (need to numbering the messages).

NOTE:

Now Collaboration diagrams are also called as communication diagrams.

Goddess answered 16/7, 2016 at 18:4 Comment(0)
G
1

A Sequence diagram is dynamic, and, more importantly, is time ordered. A Collaboration diagram is very similar to a Sequence diagram in the purpose it achieves; in other words, it shows the dynamic interaction of the objects in a system. A distinguishing feature of a Collaboration diagram is that it shows the objects and their association with other objects in the system apart from how they interact with each other. The association between objects is not represented in a Sequence diagram.

Link : http://www.developer.com/design/article.php/3102981/Collaboration-Diagram-in-UML.htm

Ganley answered 14/1, 2013 at 13:15 Comment(1)
There is no association between objects. they are called "links". What's more the sequence and communication diagrams contains the instance specifications but not objects.Prolactin
A
0
  • Use sequence diagrams to show time and to emphasize the sequence or the ordering of the interactions.

  • Use communication diagrams to emphasize the links among the participants. Communication diagrams can be a helpful supplement to the object diagrams.

Attired answered 15/10, 2014 at 11:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.