4 Answers
protected by MachavityNov 29 '18 at 19:08
Would you like to answer one of these unanswered questions instead?
Not the answer you're looking for? Browse other questions tagged visio or ask your own question.
What is a sequence diagram in UML?
Note that there are two types of sequence diagrams: UML diagrams and code-based diagrams. The latter is sourced from programming code and will not be covered in this guide. Lucidchart’s UML diagramming software is equipped with all the shapes and features you will need to model both.
Benefits of sequence diagrams
- Represent the details of a UML use case.
- Model the logic of a sophisticated procedure, function, or operation.
- See how objects and components interact with each other to complete a process.
- Plan and understand the detailed functionality of an existing or future scenario.
Use cases for sequence diagrams
- Usage scenario: A usage scenario is a diagram of how your system could potentially be used. It's a great way to make sure that you have worked through the logic of every usage scenario for the system.
- Method logic: Just as you might use a UML sequence diagram to explore the logic of a use case, you can use it to explore the logic of any function, procedure, or complex process.
- Service logic: If you consider a service to be a high-level method used by different clients, a sequence diagram is an ideal way to map that out.
- Sequence diagram Visio - Any sequence diagram that you create with Visio can also be uploaded into Lucidchart. Lucidchart supports .vsd and .vdx file import and is a great Microsoft Visio alternative. Almost all of the images you see in the UML section of this site were generated using Lucidchart.
Basic symbols and components
Symbol | Name | Description |
---|---|---|
Object symbol | Represents a class or object in UML. The object symbol demonstrates how an object will behave in the context of the system. Class attributes should not be listed in this shape. | |
Activation box | Represents the time needed for an object to complete a task. The longer the task will take, the longer the activation box becomes. | |
Actor symbol | Shows entities that interact with or are external to the system. | |
Package symbol | Used in UML 2.0 notation to contain interactive elements of the diagram. Also known as a frame, this rectangular shape has a small inner rectangle for labeling the diagram. | |
Lifeline symbol | Represents the passage of time as it extends downward. This dashed vertical line shows the sequential events that occur to an object during the charted process. Lifelines may begin with a labeled rectangle shape or an actor symbol. | |
Option loop symbol | Used to model if/then scenarios, i.e., a circumstance that will only occur under certain conditions. | |
Alternative symbol | Symbolizes a choice (that is usually mutually exclusive) between two or more message sequences. To represent alternatives, use the labeled rectangle shape with a dashed line inside. |
Common message symbols
Symbol | Name | Description |
---|---|---|
Synchronous message symbol | Represented by a solid line with a solid arrowhead. This symbol is used when a sender must wait for a response to a message before it continues. The diagram should show both the call and the reply. | |
Asynchronous message symbol | Represented by a solid line with a lined arrowhead. Asynchronous messages don't require a response before the sender continues. Only the call should be included in the diagram. | |
Asynchronous return message symbol | Represented by a dashed line with a lined arrowhead. | |
Asynchronous create message symbol | Represented by a dashed line with a lined arrowhead. This message creates a new object. | |
Reply message symbol | Represented by a dashed line with a lined arrowhead, these messages are replies to calls. | |
Delete message symbol | Represented by a solid line with a solid arrowhead, followed by an X. This message destroys an object. |
Sequence diagram examples
Sequence diagram of a hospital management system
Sequence diagram for ATM systems
How to make a sequence diagram
- Open a blank document or start with a template.
- To the left of the editor, click 'Shapes' to open the Shape Library Manager.
- Check 'UML' to enable all of the UML shape libraries or 'UML' to enable shapes specific to UML sequence diagrams. Click 'Save.'
- Drag the symbols you need from the toolbox to the canvas.
- Then model the process flow by drawing lines between shapes while adding text.
How to create a sequence diagram
Get started with Lucidchart
Identify and add components
- Show the details of a UML use case.
- Model how a complex procedure or system operates.
- See how objects and components interact with each other in sequence to complete a process.
- Map out a real or hypothetical scenario that has many different components.
Add or import shapes
Automate the process by using sequence markup
Manually build a sequence diagram
Represent the flow of time in a sequence by clicking and dragging lines from the object shapes. Dotted lines will instantly appear, symbolizing lifelines. How long you make these lifelines depends on how many messages you must present in the sequence.
Add text and concepts to your sequence diagram
How to format sequence diagrams
Publish, implement, and share
What is a UML Diagram?
Why Use UML Diagrams?
- Problem-Solving - Enterprises can improve their product quality and reduce cost especially for complex systems in large scale. Some other real-life problems including physical distribution or security can be solved;
- Improve Productivity - By using the UML diagram, everyone in the team is on the same page and lots of time are saved down the line;
- Easy to Understand - Since different roles are interested in different aspects of the system, the UML diagram offers non-professional developers, for example, stakeholders, designers, or business researchers, a clear and expressive presentation of requirements, functions and processes of their system.
UML Diagram Key Usages
- Draft the System - In this case, the UML diagram is used by the development team to discuss the outlines and structure the overall system. This may include the forward design and the backward design for different activities, roles, actors, and so on;
- Visualize Programming Language - Different types of UML diagrams in a certain system can be translated into code directly to save time for software or related application development;
- Business Analysis - In reality, the UML diagram can also be used to analyze the business sales pathway in order to improve customer service;
What are the Types of UML Diagrams?
Structure Diagrams
- Class diagram
- Composite Structure diagram
- Object diagram
- Component diagram
- Deployment diagram
- Package diagram
Behavior Diagrams
- State Machine diagram
- Activity diagram
- Use Case diagram
- Sequence diagram
- Communication diagram
- Timing diagram
- Interaction Overview diagram
More Free UML Diagram Templates
Student Management Use Case Diagram | UML Sequence Diagram Template | Bank System Use Case Template |
UML Component Diagram Template | Ticket UML Collaboration Template | Deployment Chart Template |
UML Diagram Symbols
How to Create a UML Diagram Easily?
Create Your Own UML Diagrams Right Now!
Read More:
Explore the interactions between objects in the sequential order that those interactions occur
It’s February, and by now you’ve probably read about, or heard people talk about, making the change to UML 2.0–the new specification for UML that contains a number of improvements. Given the importance of the new spec, we are changing the basis of this article series, too, shifting our attention from OMG’s UML 1.4 Specification to OMG’s Adopted 2.0 Draft Specification of UML (a.k.a. UML 2). I hate to change emphasis from 1.4 to 2.0 in the middle of a series of articles, but the UML 2.0 Draft Specification is an important step forward, and I feel the need to spread the word.
The diagram’s purpose
The notation
Figure 1. An empty UML 2 frame element
Data Flow Diagram For Text To Speech Conversion
Figure 2. A sequence diagram that has incoming and outgoing messages
The UML specification provides specific text values for diagram types (e.g., sd = Sequence Diagram, activity = Activity Diagram, and use case = Use Case Diagram).
The basics
Lifelines
Figure 3. An example of the Student class used in a lifeline whose instance name is freshman
In the example shown in Figure 3, the lifeline represents an instance of the class Student, whose instance name is freshman. Note that, here, the lifeline name is underlined. When an underline is used, it means that the lifeline represents a specific instance of a class in a sequence diagram, and not a particular kind of instance (i.e., a role). In a future article we’ll look at structure modeling. For now, just observe that sequence diagrams may include roles (such as buyer and seller) without specifying who plays those roles (such as Bill and Fred). This allows diagram reuse in different contexts. Simply put, instance names in sequence diagrams are underlined; roles names are not.
Messages
Figure 4. An example of messages being sent between objects
Figure 5. The system object calling its determineAvailableReports method
Figure 6. A sequence diagram fragment showing an asynchronous message being sent to instance2
Guards
Figure 7. A segment of a UML 1.x sequence diagram in which the addStudent message has a guard
For example,
Combined fragments (alternatives, options, and loops)
Alternatives
Figure 8. A sequence diagram fragment that contains an alternative combination fragment
[balance >= amount]
, if the account’s balance is greater than or equal to the amount, then the sequence continues with the bank object sending the addDebitTransaction and storePhotoOfCheck messages to the account object. However, if the balance is not greater than or equal to the amount, then the sequence proceeds with the bank object sending the addInsuffientFundFee and noteReturnedCheck message to the account object and the returnCheck message to itself. The second sequence is called when the balance is not greater than or equal to the amount because of the [else]
guard. In alternative combination fragments, the [else]
guard is not required; and if an operand does not have an explicit guard on it, then the [else]
guard is to be assumed.Option
Figure 9. A sequence diagram fragment that includes an option combination fragment
Loops
minint = [the number]
(e.g., “minint = 1”) and maximum iterations written as maxint = [the number]
(e.g., “maxint = 5”). With a minimum iterations guard, the loop must execute at least the number of times indicated, whereas with a maximum iterations guard the number of loop executions cannot exceed the number.Figure 10. An example sequence diagram with a loop combination fragment
Beyond the basics
Referencing another sequence diagram
Two examples:
Retrieve Borrower Credit Report(ssn) : borrowerCreditReport
Process Credit Card(name, number, expirationDate, amount : 100)
Figure 11. A sequence diagram that references two different sequence diagrams
Two examples:
SD Balance Lookup(Integer : accountNumber) : Real
SD Available Reports(Financial Analyst : analyst) : Reports