Download Sequence Diagrams

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

List of types of proteins wikipedia , lookup

Transcript
Sequence Diagrams
Emerson Murphy-Hill
Creative Commons Attribution 4.0 License.
Material Produced by NCSU Software Engineering Faculty.
UML Sequence Diagrams
can be
 Used during requirements analysis
Light
Car
Traffic Light
Queue
Green?
 To refine use case descriptions
 To find additional objects (“participating objects”)
 Used during system design
Green
Clear?
 to refine subsystem interfaces
Clear
Go!
 Classes are represented by columns (first
column is actor that initiates use case)
 Messages are represented by arrows
time
 Activations of an operation are represented by
narrow rectangles
No significance to the horizontal orderings of the objects
Return values are optionally indicated using a dashed arrow with a label indicating the return value
Suggestion: not to indicate the return values when it is obvious what is being returned
Scenario
A player rolls the dice and gets a 6. The player moves 6 cells.
The player lands on a cell that is an un-owned property. The
player’s turn is over.
Not all nouns become objects such as, perhaps, “turn”
Dice
Player
Cell
Property
rollDice
DiceValue(6)
MoveCell(6)
isOwnedProperty
isOwnedProperty(False)
Conditional Logic
•
•
•
If the player lands on a cell that is
an un-owned property, the
player’s turn is over.
Player
Dice
Cell
Property
rollDice
If the player lands on a cell that is
owned, the player must pay rent
to the owner of the property.
DiceValue(n)
MoveCells(n)
Then, the player’s turn is over.
[isOwnedProperty]
isOwnedProperty(False)
[else]
isOwnedProperty(True,owner)
PayOwner
Owner