[null, null, {"document_url": "https://www.programminggeek.in/2013/01/sequence-diagram.html", "unformatted_src": "//1.bp.blogspot.com/-uym8yFoCzJc/UO1Gi9M83yI/AAAAAAAAACI/pKf0iPAN-w4/s400/index+(1).png", "src": "http://1.bp.blogspot.com/-uym8yFoCzJc/UO1Gi9M83yI/AAAAAAAAACI/pKf0iPAN-w4/s400/index+(1).png", "formatted_filename": "index ( )", "rendered_width": 368, "rendered_height": 400}, null, {"document_url": "https://www.programminggeek.in/2013/01/sequence-diagram.html", "unformatted_src": "//1.bp.blogspot.com/-0n16gH0WbFo/UO1HBZqEkgI/AAAAAAAAACQ/kAbBkVoOcqw/s400/1.PNG", "src": "http://1.bp.blogspot.com/-0n16gH0WbFo/UO1HBZqEkgI/AAAAAAAAACQ/kAbBkVoOcqw/s400/1.PNG", "rendered_width": 400, "rendered_height": 317}, null, {"document_url": "https://www.programminggeek.in/2013/01/sequence-diagram.html", "unformatted_src": "//4.bp.blogspot.com/-OMhc4KkFEN8/UO1HORlkJFI/AAAAAAAAACY/bKW_me-JdIo/s400/2.PNG", "src": "http://4.bp.blogspot.com/-OMhc4KkFEN8/UO1HORlkJFI/AAAAAAAAACY/bKW_me-JdIo/s400/2.PNG", "rendered_width": 400, "rendered_height": 282}, null, {"document_url": "https://www.programminggeek.in/2013/01/sequence-diagram.html", "unformatted_src": "//4.bp.blogspot.com/-8HJn9TlnN5w/UO1Hbrswo0I/AAAAAAAAACg/vkl_qZ4CiNc/s400/3.PNG", "src": "http://4.bp.blogspot.com/-8HJn9TlnN5w/UO1Hbrswo0I/AAAAAAAAACg/vkl_qZ4CiNc/s400/3.PNG", "rendered_width": 400, "rendered_height": 256}, null, {"document_url": "https://www.programminggeek.in/2013/01/sequence-diagram.html", "unformatted_src": "//1.bp.blogspot.com/-kcO-LyLURj8/UO1Hn5pLcsI/AAAAAAAAACo/HBlneqLrUmY/s400/4.PNG", "src": "http://1.bp.blogspot.com/-kcO-LyLURj8/UO1Hn5pLcsI/AAAAAAAAACo/HBlneqLrUmY/s400/4.PNG", "rendered_width": 400, "rendered_height": 205}, null, null, null, null, null, null, null, {"document_url": "https://www.programminggeek.in/2013/01/sequence-diagram.html", "unformatted_src": "//lh3.googleusercontent.com/-FFqbSyAX4UU/AAAAAAAAAAI/AAAAAAAAAIA/Y8O6RRHSfPo/s80-c/photo.jpg", "src": "http://lh3.googleusercontent.com/-FFqbSyAX4UU/AAAAAAAAAAI/AAAAAAAAAIA/Y8O6RRHSfPo/s80-c/photo.jpg", "formatted_filename": "photo", "alt_text": "My photo", "rendered_width": 80, "rendered_height": 80}, null, null]
Sequence Diagram

Vikash Verma 1/09/2013


A sequence diagram is a kind of  diagram describing how the interaction  of different object takes place and in what order.

Sequence diagram is as useful for client as it is useful to a developer to develop the application. It gives the step by step description of a particular operation. Let us take an example of login process . The following event takes place while logging into a website.

Step 1: Client makes a request to server for login page through an interface such as a browser.

Step 2: Server sends the login page to browser which is visible to client prompting to provide the login credentials.

Step 3: Client provides the login information such as username and password.

Step 4: Client side validation takes place for the proper username and password.

Step 5: Browser sends the login credentials to server where again login credentials are validated and then record is searched in database.

Step 6: If login credentials are proper then server responds to browser that authentication is accepted. Otherwise authentication failed message is forwarded to the browser.

Step 7: if authorization is accepted then home page is displayed, otherwise error page is displayed prompting to provide valid login credentials.
The following sequence diagram illustrates the login process : Now the question arises is how to develop a sequence diagram. I came across the problem of developing sequence diagram while developing SRS for TGMC (The Great Mind Challenge) organized by IBM.

http://www.websequencediagrams.com is a website providing platform to develop interactive sequence diagram. The free version has limited facility but it’s enough for general sequence diagram. All that you need to learn the it’s syntax to develop the diagram. I found it quite easy to use as a lot of illustrations were given on how to develop  the diagram. Although you need to google for better experience. I learnt a lot of syntax on this site and a few syntax by googling.

I think this may be useful to you people while developing sequence diagram for SRS on http://www.websequencediagrams.com.


Title: If you want to add a title to diagram then you can use title keyword followed by your title as illustrated below :

title Sequence Diagram for Login Process

Participant: An object is represented by a participant . Although you don’t need to specify the participant explicitly but if you need a specific order of objects then it is mandatory to specify the participant.

for above diagram, we may create participant as follows:

participant User
participant Interface
participant EHADatabase

# : It is used to provide a comment.
e.g. # this is a comment

Drawing Simple Signal

A simple signal from one object to another  object can be drawn as follows:
#The following line draws a dotted arrow from User to interface

User-->Interface: Dotted Line

#The following line draws a filled arrow from User to interface

User->Interface: Filled arrow

#The following line draws a Open arrow from User to interface

User->>Interface: Open arrow

#The following line draws a dotted line, open arrow from User to interface

User-->>Interface: Dotted Line, open arrow

Hence the complete source code looks like this :


The resulting diagram is as below: Signal to Self

A signal to self can be sent using following syntax:

User->User: This is an illustration of a signal to self

Grouping signals Together

A number of signals can be grouped together using alt/else,opt and loop. A group needs to be ended explicitly. A group can be followed by a text which is displayed as heading of the group.

alt successful case
User->Interface: This is inside a group
else in case of failure Creating Notes

A note can be created left or right to a participant. A note can be made multiline using ‘\n’ as escape sequence.

note right of Interface: This is a note\n right of Interface object Lifeline Activation, Deactivation and destruction

+ and – is used to activate and deactivate respectively. + is used to activate receiver and – is used to deactivate sender. You can explicitly deactivate an object by using deactivate keyword. An object can be destroyed by using destroy keyword.
title Sequence Diagram for Lodgimg Complaint

participant Patient
participant Admin

Interface->+Patient: Prompt to Enter Text()
Patient->+Interface: Enter Text
note left of Patient: Patient lodges complaint
Interface->+Admin: Forward()
deactivate Admin
Interface->+EHADatabase: Forward()
note right of EHADatabase: Save user complaint in database\n and generate complaint ID
EHADatabase->+Interface: Generate Complaint ID
Interface->+Patient: Display()
deactivate Patient
destroy Admin More details will be provided in future. Leave a comment if you have any suggestion or query.

Labels: creating sequence diagram , develop sequence diagram , sequence diagram , sequence diagram generation , srs , websequencediagrams.com