Analysis: Sequence Diagrams



index
Disabled back button Next Section
printable version




Section 0: Module Objectives or Competencies
Course Objective or Competency Module Objectives or Competency
The student will be able to assess and apply Object-Oriented analysis and design methods like use cases to express user requirements, UML modeling, and other OO approaches. Understand the rules and style guidelines for sequence diagrams.
Understand the processes used to create sequence diagrams.
Be able to create sequence diagrams.


Section 1: Overview

The behavior of a use case can be described by means of activity diagrams and state diagrams, interaction diagrams (sequence and communication diagrams), as well as textual use cases, where appropriate.

A sequence diagram is a dynamic model that shows the objects that participate in a use case and the explicit sequence of messages that are passed between those objects over time for one use case in a defined interaction.

Sequence diagrams can help capture required objects and classes involved in the scenario and show the order of interactions between the objects needed to carry out the functionality of the scenario.


This video explains the relationship between Sequence Diagrams and Use Cases:


You can use one or more sequence diagrams to enact a use case diagram. A sequence diagram is built for each use case in a use case diagram. Each sequence diagram specifies the main interaction steps to be achieved for each task (i.e. use case).



Section 2: Example

Recall the activity diagram for making a School Lunch from the last chapter.

Example of an Activity Diagram.

The following figure shows a sequence diagram derived from that scenario:

Example of a sequence Diagram.


Section 3: Syntax and Elements
Sequence diagram syntax.

Elements of a Sequence Diagram

Actors and objects

Actors and objects that participate in the sequence are placed across the top of the diagram using actor symbols from the use case diagram and object symbols from the object diagram.

Lifeline

A dotted line runs vertically below each actor and object to denote the lifeline of the actors and objects over time.

Execution Occurrence

A thin rectangular box, called the execution occurrence, is overlaid onto the lifeline to show when the classes are sending and receiving messages.

Messages

A message is a communication between objects that conveys information with the expectation that activity will ensue.



Section 4: Example 2

Recall the example use case from the Activity Diagrams for Make Old Patient Appointment

Use Case Description for Make Appointment.

The following sequence diagram depicts the objects and messages for the Make Old Patient Appt use case, which describes the process by which an existing patient creates a new appointment or cancels or reschedules an appointment for the doctor’s office appointment system. In this specific instance, the Make Old Patient Appt process is portrayed.

Sequence Diagram for Make Appointment.


Section 5: Guidelines for Creating Sequence Diagrams


Section 6: Creating a Sequence Diagram

The following is a six-step process used to create a sequence diagram.



Section 7: Resources