OOAD@Lecture 10_Activity State Diagrams
OOAD@Lecture 10_Activity State Diagrams
and Design
1
Business rules
In the 1st iteration, we just simply describe the main scenario how
system and actors interacting with each other.
There are certain business rules monitoring these interactions.
These can be captured by
Activity diagram
State diagram
2
Activity Diagram (chapter 28)
Activity diagram is used to
Capture business process
Model data flow
Activity diagram captures interactions between many objects/actors
3
Showing business process
Partitions. Show different
parties involved in the process
start
Fulfillment Customer Finance
Service
Invoice
Order
Receive Payment
Deliver
Order
end of activity
4
Expanding activity diagram
Fill Order
Deliver Order
Decision: Any
branch happens.
Mutual exclusion [ else ] [ rush ]
Cart
Calculate Taxes
and Discounts
[ cash [ else ]
payment ]
Submit
Authorize
Authorization
Payment
Request
6
State diagram (chapter 29)
State independent object: if an object receives a message, and the
responding method always does the same thing.
State dependent object: react differently to events depending on
their state or mode.
State diagram is used for state-dependent objects with complex
behaviour
complex reactive object in response to events.
legal sequences of operations protocol or language specifications.
7
Notation
Telephone
initial state
off hook
Idle Active state
on hook
transition event
8
Notation
transition action
on hook
guard condition
9
Nested states
Active
[valid subscriber]
Idle
PlayingDialTone Talking
complete
Dialing Connecting
10
POS Process Sale example
Process Sale
enterItem
endSale
makeCreditPayment
AuthorizingPayment makeCheckPayment
11