Anda di halaman 1dari 5

UML First Pass: Sequence Diagram

Object

:SimpleWatch :LCDDisplay :Time


:WatchUser

pressButton1() blinkHours()
pressButton1() blinkMinutes()

pressButton2() incrementMinutes()
refresh()
pressButtons1And2()
commitNewTime()
stopBlinking()

Message
Activation
Sequence diagrams represent the behavior as interactions
UML First Pass: Statechart Diagrams

Initial state State


Event
button1&2Pressed button2Pressed
Blink Increment
Hours Hours

Transition
button1Pressed

button1&2Pressed button2Pressed
Blink Increment
Minutes Minutes

button1Pressed
button1&2Pressed
button2Pressed
Stop Blink Increment
Blinking Seconds Seconds

Final state
UML Sequence Diagrams
Used during requirements
analysis
TicketMachine To refine use case descriptions
Passenger
selectZone() to find additional objects
(participating objects)
Used during system design
insertCoins()
to refine subsystem interfaces
Classes are represented by
columns
pickupChange() Messages are represented by
arrows
Activations are represented by
pickUpTicket() narrow rectangles
Lifelines are represented by
dashed lines
UML Sequence Diagrams:
Nested Messages
ZoneButton TarifSchedule Display

selectZone()
lookupPrice(selection)

price
displayPrice(price)
Dataflow

to be continued...

The source of an arrow indicates the activation


which sent the message
An activation is as long as all nested activations
State Chart Example

Waiting

Requests finished
Button press Button press (no further requests)
(other floor) (same floor)

Arrival at a request floor


Moving Service floor
(open doors)
Button press

Sample State Chart for an Elevator class

Anda mungkin juga menyukai