Professional Documents
Culture Documents
Sequence Diagrams: Software Design Methodology
Sequence Diagrams: Software Design Methodology
Outline
Introduction
Basic notation
Alternating paths
Modularity
Modeling Process
Phase
Actions
Outcome
Business
documents
Initiation
Requirements
Specification
Formal
specification
Design
Formal
Specification
Implementation
Testable
system
Testing &
Integration
Testing results,
Working sys
Maintenance
System
versions
3
getStatus, Resend?
getStatus, sendMessage, checkForMessages?
Behavioral Modeling
Behavior Modeling
Sequence Diagrams
Activity Diagrams
Checkout
Manager
Order
Add to cart
message: create
In process
Check
availability
Order
message: change
status
State Diagrams
[problem]
supplied
[okay]
Inventory
Notify
User
Supply
Order
Use Case 2
Class D
Class B
therefore
Sequence =
Objects
messages
7
Sequence Diagrams
sd Product Buying
Diagram
Name
p : Product
: ShooppingCart
customer
display()
message
getPrice()
activation
(focus of
control)
addProduct (p)
checkout ()
Life line
8
Object Control
obj1 : Class1
obj2 : Class2
user
Object
Creation
operate()
do ()
create ()
: Class3
Return
Message
foo()
Messages to
self
Object
Destruction
Illustration
9
Dependencies can
be overridden by
associations,
aggregations etc.
Illustration
10
: ShooppingCart
customer
display()
getPrice()
addProduct (p)
checkout ()
create ()
: Order
Visible part
Hidden part
11
sequence number
return value
12
asynchronous Message
Return Message
13
: Order
Asynchronous Flow
: Article
getValue
appl
err handl
alarm
unknown
ring
price
setID
log
Example
Price need to be
finished, before teller
can do another operation
(getName)
Example
Outline
Introduction
Basic elements
Alternating paths
Modularity
15
Flow Constructs
If Loop
ElseRepeat
Jump
Options
msg : Message
: Database
Fragment
opt
[msg.status=confirmed]
Condition
archive(msg)
Do something...
17
Alternatives
msg : Message
: Database
: Admin
alt
[msg.status=confirmed]
archive(msg)
Alternative
Fragment group
Condition
[msg.status=error]
notify(msg.getID())
[else]
wait()
Else
condition
(optional)
Execution regions. At
most one will execute.
18
Loops
: OS
: Folder
: File
loop
Loop
Fragment
loop
[for each File]
Display()
Condition
Nested
Loop
Fragment
19
Breaks
: User
: User Manager
: Policy
isLooged = login(name,pass)
break
[isLooged]
addBadLogin(name)
Do something
Do something
Handy in model
exception
handling
20
Examples of Guards
[for each Object]
[5]
[i=1..5]
[status = okay]
No guard means an infinite loop
21
Outline
Introduction
Basic elements
Alternating paths
Modularity
22
Modularity
Referencing a diagram
: User
: User Manager
login(name,pass)
: Policy
ref
Login Handling(user,pass) :
bool
Reference
Gate
Do something
Do something
24
Referenced Diagram
Diagram
name
sd Login Handling
: User Manager
: UserAccount
loop
Input
message
login(name,pass)
[for each UserAccount]
cName -= getUseNamer()
opt
Output
message
[cName = name]
isInSystem(true)
true
false
25
Parallel Fragments
: Checkout
Handler
: User
: Shipping
Handler
: Transaction
Handler
provideDetails()
performCheckout()
par
Ship(address,products)
chargeMoney(CC,sum)
26
Critical Fragment
27
Summary
9
Behavior Modeling
Sequence models interaction
Language
Objects + lifeline
Messages
Alternations
Loops
Alternatives
Modularity
Referencing
Parallel
28