Presentation is loading. Please wait.

Presentation is loading. Please wait.

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.

Similar presentations


Presentation on theme: "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."— Presentation transcript:

1 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

2 Figure 15.2 Sequence Diagram

3 Figure 15.4 Sequence diagram

4 Figure 15.17 Focus of control

5 Figure 15.18 Showing returns

6 Figure 15.19 Message to ‘this’

7 Figure 15.21 Destroying an object

8 Figure 15.22 Conditional message

9 Figure 15.23 Mutually exclusive conditional messages

10 Figure 15.24 Iteration

11 Figure 15.25 Iteration over a sequence of messages

12 Figure 15.26 Iteration over a multiobject

13 Figure 15.27 Messages to a class itself, not an object

14 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

15 Sequence Diagram - example :OLine:Product 1:hasStock:=checkQOH() 2:[hasStock]remove() :DelItem 3:[hasStock]new() :BOItem 4:[not hasStock]new() Message numbers are not necessary on SD, and are not shown in the text.

16 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

17 Sequence Diagram - example 2 :OLine:Product 1:hasStock:=checkQOH() 2:[hasStock] remove() :RItem 2.1:needToReorder:=checkLevel() 2.3:[needToReorder] new()

18 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

19 Sequence Diagram - example 3 :OLine:Product 1.1:hasStock:=checkQOH() 1.2:[hasStock] remove() :PO 1:*[for each line] checkQOH()

20 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

21 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()

22 As a Collaboration Diagram 128937:POrder :OLine : DelItem {new} 1*[for all order lines] checkQOH() 1.1: hasStock:=checkQOH() 1.2: [hasStock] remove() 1.2.1: needToReorder := checkLevel() 1.2.2:[needToReorder] new() 1.3a: [hasStock] new() :Product :RItem {new} 1.3b: [not hasStock] new() :BOItem {new}


Download ppt "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."

Similar presentations


Ads by Google