Open In App

What is the Difference between Solid and Dotted Line in Sequence Diagram?

Last Updated : 29 Feb, 2024
Improve
Improve
Like Article
Like
Save
Share
Report

In Sequence Diagrams, solid and dotted lines are used to show different kinds of messages between objects.

  • A solid line represents a message where the sender waits for a response from the receiver before continuing.
  • A dotted line represents a message where the sender does not wait for a response and continues right away

Solid Line

A solid line represents a synchronous message, where the sender waits for a response from the receiver before continuing its processing. When an object sends a message along a solid line, it will pause its execution and wait until it receives a response or until the message is processed by the receiver.

For Example:

In a banking system, a customer sends a request to withdraw money.

The customer’s account object sends a synchronous message to the bank’s account object, which processes the request and sends a response back to the customer’s account object.

Dotted Line

A dotted line represents an asynchronous message, where the sender does not wait for a response from the receiver and continues its processing immediately after sending the message. When an object sends a message along a dotted line, it does not wait for a response and continues its execution independently of the receiver’s processing.

For Example:

In a messaging application, a user sends a message to another user.

The sender’s messaging object sends an asynchronous message to the receiver’s messaging object, which processes the message at its own pace without immediate feedback to the sender.

In conclusion, solid lines in sequence diagrams represent synchronous messages, where the sender waits for a response, while dotted lines represent asynchronous messages, where the sender does not wait for a response and continues its processing independently


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads