Object Oriented Analysis
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
Action. It does something.
There is an automatic
transition on its completion.
Receive Video
Object Node. An object Order A transition supports
produced or used by actions. modeling of control flow.
This allows us to model data
flows or object flows. Fork. One incoming
transition, and multiple
outgoing parallel transitions
and/or object flows.
Fill Order Send Invoice
Invoice
Order
Receive Payment
Deliver
Order
Join. Multiple incoming transitions and/or
object flows; one outgoing transition.
The outgoing continuation does not happen Close Order
until all the inputs arrive from all flows.
end of activity
4
Expanding activity diagram
Fill Order
the “rake” symbol (which
represents a hierarchy)
indicates this activity is
expanded in a sub-activity Deliver
diagram Order
Deliver Order
Decision: Any
branch happens.
Mutual exclusion [ else ] [ rush ]
Deliver Regular Deliver Rush
Merge: Any input leads
to continuation. This is
in contrast to a join, in
which case all the
inputs have to arrive
before it continues.
5
POS activity diagram
Authorization
Customer Cashier NextGen POS
Service
Shop and Fill
Cart
Cart
Enter Cart Items
Calculate Taxes
and Discounts
[ cash [ else ]
payment ]
Submit
Authorize
Authorization
Payment
Request
Receipt Create Receipt
Hand Over Items
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
off hook / play dial tone
[valid subscriber]
Idle Active
on hook
guard condition
9
Nested states
Active
[valid subscriber]
Idle
PlayingDialTone Talking
digit digit connected
complete
Dialing Connecting
10
POS Process Sale example
Process Sale
WatingForSale makeNewSale EnteringItems
enterItem
endSale
authorized makeCashPayment WaitingForPayment
makeCreditPayment
AuthorizingPayment makeCheckPayment
11