differences between sequence diagram and collaboration diagram - modeling

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?

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

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

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.

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.

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

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.

Related

What is the difference between use-case diagram and sequence diagram in unified process model?

I'm studying UML and I am confused.Could anyone explain me What is the difference between use-case diagram and sequence diagram in unified process model?
The use-case diagram shows the objectives that make external actors interact with the system. It‘s about relations with the outside world. Each use-case is independent and not sequenced with the others.
The sequence diagram shows a scenario of interaction between objects within the system. The interaction in the diagram correspond to message that are exchanged in a given sequence.

Representing Sequence Diagram for an ERP system

I want to model sequence diagram for my ERP System that has twelve modules as follows:
CRM
HRM
SRM
Order Management
invoicing
reports generation
POS
accounts management
Inventory
Material management
Warranty claim
How to address/breakdown inter-module relationship and represent them in terms of sequence diagram?
Sequence diagram has a higher granularity than component or deployment diagram.
So if you want to represent your system in one single diagram, I would suggest going with a component diagram instead of the sequence diagram.
Sequence diagram represents communication flow between objects in
terms of messages which are more granular compared to each module in
your system.
Each module of your system will have multiple sequence diagram and representing entire system would be a too much complicated. UML diagrams are to represent the system in a most simpler way.
I hope this answers your question.
Thanks.

Sequence Diagram vs Usecase Diagram

I have build a usecase diagram for hotel reservation
Should i build a sequence diagram for each usecase in the usecase diagram, or can i summarize multiple usecase in a single sequence diagram?
A use case diagram shows how use cases and actors relate to each other and gives a usefulness system overview. Use cases boil the system down to their added values and do not show how these are achieved.
Any scenario of a use case is graphically represented in an activity diagram where the single steps occur as actions.
A sequence diagram is used to show how objects communicate.
Usually you derive classes and relate them to actions of the use case activities. So when you create a sequence diagram it highlights a certain aspect of the whole system. This highlight is usually spot on and not a floodlight. Putting multiple use case scenarios in a single SD would for sure simply blind any reader instantly.
Usecase diagram
Use case diagrams show business use cases, actors, and the relationships between them. The relationships between actors and business use cases state that an actor can use a certain functionality of the business system. You will not find any information about how or in what chronological sequence these services are rendered
sequence diagram
A sequence diagram can map a scenarios described by a use case in step by step detail to define how objects collaborate to achieve your application's goals.
Here is the diagram , which will clear things better to you

What is the difference between sequence diagram and communication diagram?

Could anyone explain me what is the difference between sequence diagram and communication diagram?
Both diagrams give the same information, but the sequence diagram emphasizes time in its layout and the communication diagram emphasizes the objects that are communicating in its layout.
Time is implicit in sequence diagrams (it is inferred by vertical position), while it is given explicitly in communication diagrams (via numbers).
To quote Scott Ambler
The main difference between communication diagrams and sequence diagrams is that sequence diagrams are good at showing sequential logic but not that good at giving you a “big picture view” whereas communication diagrams are the exact opposite.
emphasizing the time ordering of messages (using sequence diagrams)
emphasizing the structural relationships among the objects that interact (using communication diagrams).
reference :UML user manual
Sequence diagrams illustrate interactions in a kind of fence format, in which each new object is added to the right.
What might this represent in code? Probably, that class A has a method named doOne and an attribute of type B. Also, that class B has methods named doTwo and doThree. Perhaps the partial definition of class A is:
public class A
{
private B myB = new B();
public void doOne()
{
myB.doTwo();
myB.doThree();
}
// . .
}
Communication diagrams illustrate object interactions in a graph or network format, in which objects can be placed anywhere on the diagram (the essence of their wall sketching advantage).
What are the Strengths and Weaknesses of Sequence vs. Communication Diagrams?
Each diagram type has advantages, and modelers have idiosyncratic preference—there isn't an absolutely "correct" choice. However, UML tools usually emphasize sequence diagrams, because of their greater notational power.
Sequence diagrams have some advantages over communication diagrams. Perhaps first and foremost, the UML specification is more sequence diagram centric—more thought and effort has been put into the notation and semantics. Thus, tool support is better and more notation options are available. Also, it is easier to see the call-flow sequence with sequence diagrams—simply read top to bottom. With communication diagrams we must read the sequence numbers, such as "1:" and "2:". Hence, sequence diagrams are excellent for documentation or to easily read a reverse-engineered call-flow sequence, generated from source code with a UML tool.
But on the other hand, communication diagrams have advantages when applying "UML as sketch" to draw on walls (an Agile Modeling practice) because they are much more space-efficient. This is because the boxes can be easily placed or erased anywhere—horizontal or vertical. Consequently as well, modifying wall sketches is easier with communication diagrams—it is simple (during creative high-change OO design work) to erase a box at one location, draw a new one elsewhere, and sketch a line to it. In contrast, new objects in a sequence diagrams must always be added to the right edge, which is limiting as it quickly consumes and exhausts right-edge space on a page (or wall); free space in the vertical dimension is not efficiently used. Developers doing sequence diagrams on walls rapidly feel the drawing pain when contrasted with communication diagrams.
A fundamental rule in Object Oriented Design is to use different diagrams based on diverse purposes. In this regard, sequence diagrams are used to model sequential logic while to show the behavior of several objects collaborating together to fulfill a common purpose the communication diagrams, formerly known as collaboration diagrams in UML 1.x, can be used. - Read more >> here << and >> here <<
The below link is the short answer for difference between sequence diagram and communication.
Please refer it.
difference between sequence diagram and communication

Scenario diagram vs sequence diagram

What's the difference between sequence diagrams and scenario diagrams in UML?
I think you mean System Sequence Diagram (SSD) and Sequence Diagram.
The purpose of SSD is to illustrate a particular use-case scenario in a visual format where the system appears as a black box.
Sequence Diagram, on the other hand, shows how system objects interact over time for achieving a particular scenario of a use-case.
"Scenarios" per your link aren't diagrams, they're narrative text. They're also called "Use Case Narratives" among other terms. They are approximately equivalent to other behaviour specifications (sequence diagrams, activity diagrams).
There are generally three differences:
Format. Scenarios are textual, sequence/activity diagrams are, well, diagrams
Content. Textual narrative is often used to describe the sequence of interactions between the user and the "system" in Use Case descriptions. Hence there are usually only two participants (User & System). In contrast, sequence diagrams are primarily used to show how behaviour is distributed among objects. Consequently there will usually be more than two participants.
Formality. Narratives are often used earlier in the cycle to get an idea of what's needed. Consequently they're often less formal than Sequence diagrams - which typically show inter-object messages ("method calls").
For examples of tools that do this, take a look at websequencediagrams.com. Or search for "free UML tools".
There is no diagram type called scenario. Maybe you are thinking of collaboration?
Sequence and collaboration diagrams are actually the same: the Sequence depicts the chronology while the Collaboration depicts the interactions between the collaborators. Together (a tool that was around a decade ago) used to let you literally just change the setting and see the diagram in the other mode.
I use OmniGraffle (Mac). It's great for class diagrams. Has support for Sequence diagrams but not Collaboration.

Resources