Compare the Difference Between Similar Terms

Difference Between

Home / Technology / IT / Programming / Difference Between Sequence Diagram and Collaboration Diagram

Difference Between Sequence Diagram and Collaboration Diagram

March 20, 2018 Posted by Lithmee

Key Difference – Sequence Diagram vs Collaboration Diagram
 

Before developing software, it is necessary to have a good understanding of what should be developed. Therefore, it is required to design the system. It can be done using Unified Modeling Language (UML). It is not a programming language such as Java, C#. It is used to get a visual representation of the system. With the introduction of Object Oriented Programming (OOP), most programs and software were developed. It is a paradigm that helps to model a software with objects. The OOP concepts such as inheritance, encapsulation can be represented using UML. It is easy and simple to understand. It can be used even by non-programmers. Generally, one diagram is not enough to understand the entire system. There are various types of UML diagrams each covering different aspects. The sequence diagram and collaboration diagram are two interaction diagrams. The key difference between sequence diagram and collaboration diagram is that the sequence diagram is used when the time sequence is more important while the collaboration diagram is used when the object organization is more important. This article discusses the difference between sequence diagram and a collaboration diagram.

CONTENTS

1. Overview and Key Difference
2. What is Sequence Diagram
3. What is Collaboration Diagram
4. Similarities Between Sequence Diagram and Collaboration Diagram
5. Side by Side Comparison – Sequence Diagram vs Collaboration Diagram in Tabular Form
6. Summary

What is Sequence Diagram?

The sequence diagrams are used to represent the interaction between objects over a specific period of time. The request messages are represented by dark arrows, and the return messages are denoted by the dashed arrows. The rectangle vertical boxes represent the activation time of each object.

Difference Between Sequence Diagram and Collaboration Diagram

Figure 01: A Sequence Diagram

According to the above diagram, the customer object, sends a message to the product object to see whether the product is available. The product object sends a message to the stock object to find whether the product is available in the stock. Depending on the product availability, the stock will reply the product, and the product will reply the customer. Then the customer object sends the pay money message to the payment object. Finally, the receipt message is sent to the customer.  The requested product, pay money requests. They are denoted by dark arrows. The yes/no, receipt are return messages. They are denoted by dashed arrows. The customer object is active throughout this process. The product and stock objects are active at the beginning. The payment object is active at the end because it should be activated to complete the payment. Overall, the sequence diagram provided information on the interaction between objects within the specific time period.

What is Collaboration Diagram?

A collaboration diagram focuses on the interaction between objects. It displays the object organization. A number indicates the method call sequence. Each number represents the method it is called.

Key Difference Between Sequence Diagram and Collaboration Diagram

Figure 02: A Collaboration Diagram

According to the above collaboration diagram, the objects are represented using rectangles. The messages are represented by an arrow and a sequence number. The first message is order product. The second message is get price and the third message is do payment. Likewise, each message is given a sequence number. So, the number indicates how the methods are called one after the other. The conditional statements are denoted by square brackets. The payment via master and visa are separate conditions. The payment by master and the payment by visa belong to payment. So, they are denoted by 3.1 and 3.2.

What are the Similarities Between Sequence and Collaboration Diagram?

  • Both Sequence and Collaboration Diagram are interaction diagrams in UML.
  • Both Sequence and Collaboration Diagram describe the behavioural aspects of the system.

What is the Difference Between Sequence and Collaboration Diagram?

Sequence vs Collaboration Diagram

The sequence diagram is a UML representation to visualize the sequence of calls in a system to perform a specific functionality. The collaboration diagram is a UML representation to visualize the organization of the objects and their interaction.
 Representation
The sequence diagram represents the sequence of messages flowing from one object to another. The collaboration diagram represents the structural organization of the system and the messages sent and received.
Usage
If the time sequence is important, the sequence diagram can be used. If the object organization is important, then the collaboration diagram can be used.

Summary – Sequence Diagram vs Collaboration Diagram

When developing software, it is not possible to start developing directly. It is required to understand the system. UML is used to get a pictorial understanding of the system. UML is easier than general purpose programming languages such as Java, C++ etc. There are various UML diagrams which cover different aspects. Two of them are sequence diagram and a collaboration diagram. The difference between sequence diagram and collaboration diagram is, the sequence diagram is used when the time sequence is more important while the collaboration diagram is used when the object organization is more important.

Reference:

1.dnfvideo. UML Sequence Digram, .NET Interview Preparation Videos, 16 Aug. 2010. Available here 
2.“UML – Interaction Diagrams.”, Tutorials Point, 8 Jan. 2018. Available here 
3.“UML – Standard Diagrams.”, Tutorials Point, 8 Jan. 2018. Available here  
4.Collaboration Diagrams, CMS Support, 25 Aug. 2015. Available here

Related posts:

Difference Between QTP 9.5 and QTP 10 Difference Between Assembler and Interpreter Difference Between getc and getchar_Figure 02Difference Between getc and getchar Difference Between Perl and PythonDifference Between Perl and Python Difference Between Source Code and BytecodeDifference Between Source Code and Bytecode

Filed Under: Programming Tagged With: Collaboration Diagram, Collaboration Diagram Definition, Collaboration Diagram Representation, Collaboration Diagram Usage, Compare Sequence Diagram and Collaboration Diagram, Sequence Diagram, Sequence Diagram and Collaboration Diagram Differences, Sequence Diagram and Collaboration Diagram Similarities, Sequence Diagram Definition, Sequence Diagram Representation, Sequence Diagram Usage, Sequence Diagram vs Collaboration Diagram

About the Author: Lithmee

Lithmee Mandula is a BEng (Hons) graduate in Computer Systems Engineering. She is currently pursuing a Master’s Degree in Computer Science. Her areas of interests in writing and research include programming, data science, and computer systems.

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Request Article

Featured Posts

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and Cold Symptoms

Difference Between Coronavirus and SARS

Difference Between Coronavirus and SARS

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Influenza

Difference Between Coronavirus and Covid 19

Difference Between Coronavirus and Covid 19

You May Like

Difference Between Oxide and Dioxide

Difference Between Oxide and Dioxide

Difference Between Political Map and Physical Map

Difference Between Political Map and Physical Map

Difference Between Flammable and Highly Flammable

Difference Between Leave and Abandon

Difference Between Kingdom and Empire

Difference Between Kingdom and Empire

Latest Posts

  • What is the Difference Between Carbamazepine and Oxcarbazepine
  • What is the Difference Between HTLV 1 and 2
  • What is the Difference Between Bohr Effect and Haldane Effect
  • What is the Difference Between Oxybenzone and Avobenzone
  • What is the Difference Between Flakiness Index and Elongation Index
  • What is the Difference Between Salmonella and Shigella
  • Home
  • Vacancies
  • About
  • Request Article
  • Contact Us

Copyright © 2010-2018 Difference Between. All rights reserved. Terms of Use and Privacy Policy: Legal.