Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

differences between sequence diagram and collaboration diagram

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?

like image 581
Carlos Avatar asked Jan 14 '13 13:01

Carlos


People also ask

What is the difference between collaboration diagram and sequence diagram?

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.

What is the difference between sequence diagram and communication diagram?

A communication diagram offers the same information as a sequence diagram, but while a sequence diagram emphasizes the time and order of events, a communication diagram emphasizes the messages exchanged between objects in an application. Sequence diagrams can fall short of offering the "big picture.”

What are the main differences between sequence diagrams and class diagrams?

A class diagram shows a set of classes, interfaces and their relationships and illustrates the static design view of a system, while a sequence diagram shows the sequence of actions that occurs in a system and illustrates the dynamic view of a system.

What is difference between component diagram and sequence diagram?

A component diagram represents how the components are wired together to form a software system where as a sequence diagram is an interaction diagram which represents how the processes operate with each other and their order of operation.


2 Answers

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

like image 82
Marco Brambilla Avatar answered Nov 07 '22 12:11

Marco Brambilla


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).

like image 26
Denis Ivanov Avatar answered Nov 07 '22 11:11

Denis Ivanov