UML Diagrams:
Sequence Diagrams
The Requirements Model, and
The Dynamic Analysis Model
Prof. Hany H. Ammar, CSEE, WVU, and
Dept. of Computer Science, Faculty of
Computers and Information, Cairo
University
Outline
•
•
•
•
•
•
•
The Requirements Model and the Analysis model
Importance of Sequence Diagrams
Rules of sequence diagrams
Use Cases and Sequence Diagrams
The System Sequence Diagrams
The Vending Machine Example
Other Examples
The Requirements Model and the
Analysis Model
The Requirements
Elicitation
Process
Functional/
Nonfunctional
Requirements
Use Case Diagrams/
Sequence Diagrams
(the system level)
The Object-Oriented
Static Analysis - Class Diagrams
Analysis
Dynamic Analysis - State Diagrams/
Process
Refined Sequence
Diagrams (The object
level)
Importance of Sequence Diagrams
• Depict object interactions in a given
scenario identified for a given Use Case
• Specify the messages passed between
objects using horizontal arrows including
messages to/from external actors
• Time increases from Top to bottom
Rules of Sequence Diagrams
• Sequence Initiation
Object1:C1
Object2:C2
Click Update Button
updateStatus( )
Use r
Rules of Sequence Diagrams
• Identify objects needed to support use case,
determine sequence of internal events
following the external initiating event
• Diagrams that are not initiated with an external
actor represent only a partial sequence
• Partial sequence diagrams should clearly identify
the actor initiated sequence diagrams from which
they are launched
Rules of Sequence Diagrams
• Messages specified on interactions can be
synchronous or asynchronous
Object1:C1
Object2:C2
updateStatus( )
Object3:C3
Object1:C1
generateMessage( )
Object2:C2
calcRoute( )
route
Implicit Returns
Synchronous call
Explicit Return
Rules of Sequence Diagrams
Asynchronous call
Object1:C1
{active}
Object2:C2
{active}
asynchronous_Call ()
callBack ()
Rules of Sequence Diagrams
• Display operation names on call arrows
factory:
cmd_pktCToCHeaderFactory
c:client
buildHeader( char * )
header
header:
cmd_pktCToCCommandHeader
«create»
Rules of Sequence Diagrams
Compound and Simple Iteration
:Subsystem
:Resource
:InterfaceContainer
:Interface
:Interface
:DiscreteFD
:DiscreteFD
getInterfaceContainer()
* [for all
Interfaces in
Container]
{
Find( )
setState( )
amMasterSI( )
* [for all Interfaces in Container] publishState()
setOn( ) / setOff( )
‘included’ sequence diagrams
CMM:process
target:process
Application Process
w ith CIF
Command Request
<<includes>>
Process Command
Request sequence
Command Request
Command Response
Command Response
<<includes>>
Process Command
Response sequence
Showing alternate behavior in a sequence
diagram
:CmdHandler
:CmdValidater
:CmdRouter
issueCommand( )
validateCommand( )
User Application
[if valid command] routeCommand( )
[if invalid command] logError( )
display(status)
:EventLog
:StatusDialog
Showing Extension Point
:CmdHandler
:CmdValidater
:CmdRouter
issueCommand( )
validateCommand( )
Use r Application
routeCommand( )
Extension Point
[invalid command]
abort command
request and send
system message
display( status)
:StatusDialog
Specifying Timing Requirements
CMM : process
target : process
Use r Application
a: Command
Create Transaction
b: Command
{b.receiveTime
a.sendTime + 50ms}
c: Response
Remove Transaction
d: Response
{d.receiveTime
a.sendTime + 1s}
Requirements Elicitation Process
Step 4. Refining Use Cases using
System Sequence Diagrams
• System sequence diagrams establish the dynamic behavior
in terms of key scenarios of the system for each use case
• The system sequence diagram models a scenario of the
system interactions with the environment for a given use
case
• Input/output events are clearly identified in each sequence
diagram,
• The State of the system before and after each event are also
depicted
• Different diagrams model scenarios with the normal flow
of events and the abnormal flow of events
Sequence Diagrams and Use Cases
System Sequence Diagram
System: S
Actor2
Actor1
S1
E11
List of Guide Words
S2
E12
E21
List of Guide Words
List of Guide Words
S3
E31
The use case diagram
Of system S
List of Guide Words
E41
List of Guide Words
E22
List of Guide Words
S4
E32
List of Guide Words
The sequence diagram of use case UC1 for system S
Example: Use Case Diagram of the
Vending Machine
Deposit Money
Make Selec tion
Custome r
Canc ellation
Update Database
Mainte nance
Ope rator
Requirements Elicitation Process
Step 6. Identify Initial Analysis
Objects- The Initial Object-Model
<<actor>>
Money
Detection
Hardware
<<actor>>
Numeric Keypad
<<actor>>
Wireless
Keyboard
Vending Machine
Controller
<<actor>>
<<actor>>
Money Dispenser
<<actor>>
Product
Dispenser
CRT Display
Product Database
Designate the Actor objects with the <<actor>> stereotype
above the object label
System Sequence Diagram
for Deposit Money Use Case
Money Detection
Hardware
CRT Dis play
Vending Machine
Controller
Money
Dis pens er
Customer
[Idle State]
Dis play Welcome
Mes s age
Depos it Money
Dis play Amount
Send Amount
Start Timer
Prompt for Selection
[If Timer > 30 s econds and Invalid or No Selection]
Return Money
[Idle State]
Dis play Welcome
Mes s age
Stop
Timer
System Sequence Diagram
for Make Selection Use Case
Numeric Keypad
CRT Display
Vending Machine
Controller
Money
Dispenser
Product
Dispenser
Customer
Note: If
Release-Input
Button Pressed see
Cancellation
Sequence Diagram
Prompt
for
Selection
Enter Selection
Display Selection
Send Selection
Inquire Database
Return Response
Note: Insufficient
money, selection
not available
Validate
[if Invalid Selection]
Prompt for Another Selection
Update Database
Dispense Product
[Idle State]
Display Welcome
Message
Dispense Calculated
Change
Product
Database
System Sequence Diagram
for Cancellation Use Case
Numeric Keypad
Vending Machine
Controller
Money Dispenser
CRT Display
Customer
Prompt
for
Selection
Release-Input
Button Pressed
Send Cancellation Signal
Return Money
[Idle State]
Display Welcome
Message
System Sequence Diagram
for Update Database Use Case
Wireless Keyboard
Vending Machine
Controller
Product
Database
CRT Display
Maintenance
Operator
Power On
Send Active Signal
Display Programming
Information
Disable
Send Update Commands
Update Database
Display Update
Commands
Power Off
Terminate Update Mode
Enable
[Idle State]
Display Welcome Information
All Hardware
Except CRT Display
Other Examples of Sequence Diagrams
A Simple Example of Using UML2
• EXAMPLE: SATELLITE CONTROL
SYSTEM
A Simple Example Using UML2
• SATELLITE CONTROL SYSTEM
Architectural behavior
© Copyright 2026 Paperzz