Sequence Diagram Objects are represented horizontally across the top of the diagram The first object...
-
Upload
kayden-creswell -
Category
Documents
-
view
214 -
download
0
Transcript of Sequence Diagram Objects are represented horizontally across the top of the diagram The first object...
Sequence Diagram
•Objects are represented horizontally across the top of the diagram
•The first object is an Actor, the one who initiated the Use Case
•Each object has a lifeline
•some exist before and after the Use Case
•some are created during the Use Case
•some are destroyed during the Use Case
•An active object is indicated by a narrow rectangle
•(on the activation stack)
•Time is represented vertically down the diagram. Time moves forward as you go downwards
Sequence Diagram - example
Check to see if there is enough quantity on hand
If there is, then remove that quantity from inventory and create a delivery item for those goods
If there is not enough on hand, then create a back order line item
We have 4 objects: an orderLine, product, delivery line item, and a back order line item.
The delivery line item and back order line item will be created during the scenario
Sequence Diagram - example
:OLine :Product
1:hasStock:=checkQOH()
2:[hasStock]remove()
:DelItem3:[hasStock]new()
:BOItem
4:[not hasStock]new()
Message numbers are not necessary on SD, and are not shown in the text.
Sequence Diagram - example 2
Check the quantity on hand
if there is adequate stock, then check for the need to reorder
if we need to reorder then create a reorder line item
Sequence Diagram - example 2
:OLine :Product
1:hasStock:=checkQOH()
2:[hasStock] remove()
:RItem
2.1:needToReorder:=checkLevel()
2.3:[needToReorder] new()
Sequence Diagram - example 3
For each line of a purchase order
check the quantity on hand
if there is enough, remove the quantity from inventory
Sequence Diagram - example 3
:OLine :Product
1.1:hasStock:=checkQOH()
1.2:[hasStock] remove()
:PO
1:*[for each line] checkQOH()
Sequence Diagram Example
Consider the sequence of events:
For each line of a purchase order
Check the quantity on hand
If there is enough,
remove that quantity from inventory
create a delivery item for those goods
check for the need to reorder
if we need to reorder then create a reorder line item
If there is not enough on hand, then create a back order line item
As a Sequence Diagram
:OLine :Product
hasStock:=checkQOH()
[hasStock] remove()
:PO
*[for each line] checkQOH()
:DelItem
:BOItem
[hasStock] new()
[not hasStock] new()
:RItem
needToReorder := checkLevel()
[needToReorder] new()