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 typically an Actor, the one who initiates Each.

Similar presentations


Presentation on theme: "Sequence Diagram Objects are represented horizontally across the top of the diagram The first object is typically an Actor, the one who initiates Each."— Presentation transcript:

1 Sequence Diagram Objects are represented horizontally across the top of the diagram The first object is typically an Actor, the one who initiates 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 Numbering is not required to know the message sequencing

3 Figure 15.4 Sequence diagram A payment object is created, and therefore shown lower down in the time sequence

4 Figure 15.17 Focus of control The sale object is activated three different times The sale object sends a message to the register object - this activation is distinct from the initial activation of the register

5 Figure 15.18 Showing returns

6 Figure 15.19 Message to ‘this’

7 Figure 15.21 Destroying an object A destroyed object is explicitly shown with a large X at that point in its lifeline

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 In this case, the sale object is sending the getSubtotal message synchronously to each of its salesLineItems

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

14 Sequence Diagram - example Context: an order line is ordering a specific quantity of a product. The product must check that there is enough on hand. If there is, the product must remove that quantity from inventory and the order line will create a delivery item for those goods If there is not enough on hand, the order line will create a back order line item

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

16 Sequence Diagram - example 2 Similar to before, but suppose the product’s remove method will check for the need to reorder by invoking its checkLevel method if we need to reorder then create a reorder line item

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


Download ppt "Sequence Diagram Objects are represented horizontally across the top of the diagram The first object is typically an Actor, the one who initiates Each."

Similar presentations


Ads by Google