01.01.2015 Views

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

UML Weekend Crash Course™ - To Parent Directory

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Session 16—Modeling the Dynamic View: The Sequence Diagram 169<br />

Bill : Customer<br />

Bill's Order : Order<br />

: Inventory<br />

1: Order()<br />

2: return order<br />

3 [for each product] : additem(product)<br />

4: productAvailable(product)<br />

5: return yes<br />

6 [product available=yes] : addProduct(product)<br />

7: return done<br />

8: return done<br />

There is more to this scenario<br />

than shown here.<br />

Figure 16-1<br />

A basic Sequence diagram<br />

Defining the basic notation of the Sequence diagram<br />

All Sequence diagrams are modeled at the object level rather than the class level to allow for<br />

scenarios that use more than one instance of the same class and to work at the level of<br />

facts, test data, and examples. The Sequence diagram uses three fundamental notation elements:<br />

objects, messages/stimuli, and object lifeline.<br />

In the Sequence diagram, the objects use the same notation as in the Object diagram. In<br />

Figure 16-1, you see the three participating objects lined up across the top of the diagram.<br />

The object lifeline (identified by reference #1 in Figure 16-2) is a vertical dashed line below<br />

each object. The object lifeline always runs from the beginning at the top to the end at the<br />

bottom. The amount of time represented depends on the scenario or other behavior you’re<br />

modeling.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!