Oose 2
Oose 2
Actor
ReadTime
SetTime
WatchUser WatchRepairPerson
ChangeBattery
Association
Class
Multiplicity Watch
1 1 1 1
2 1 2 1
PushButton LCDDisplay Battery Time
state blinkIdx load now
push() blinkSeconds(
release() )
blinkMinutes(
)
blinkHours()
stopBlinking(
)
Attribute referesh()
Operations
pressButton1() blinkHours()
pressButton1() blinkMinutes()
Activation
Lifeline
Exit condition:
• Passenger has ticket.
Anything missing ?
Exceptional cases!
Modeling with UML - KMU 44
The <<extends>> Relationship
• <<extends>> relationships represent
exceptional or seldom invoked cases.
• The exceptional event flows are factored
Passenger
out of the main event flow for clarity.
• Use cases representing exceptional
flows can extend more than one use
case.
PurchaseTicket
• The direction of a <<extends>>
<<extends>>
relationship is to the extended use case
<<extends>>
<<extends>>
Cancel NoChange
Modeling with UML - KMU 45
The <<includes>> Relationship
• <<includes>> relationship
represents behavior that is
Passenger factored out of the use case.
• <<includes>> behavior is
factored out for reuse, not
PurchaseMultiCard because it is an exception.
CollectMoney
<<extends>> <<extends>>
NoChange Cancel
Modeling with UML - KMU 46
Class Diagrams
TarifSchedule
Trip
Enumeration getZones() zone:Zone
* *
Price getPrice(Zone) Price: Price