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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Session 17—Applying the Sequence Diagram to the Case Study 183<br />

The system uses this item number to ask Inventory if the product is available in step 10.<br />

Inventory replies that it is available (true) in step 11. Since the product is available, the<br />

system tells the Order to mark the item “filled”, in step 12, and to return the actual Product<br />

in step 13. The system uses the Product to tell Inventory to remove this Product from the<br />

Inventory records because it has been allocated to the Order. The Inventory responds saying<br />

that the operation succeeded (return true in step 15).<br />

:OrderFulfillment Clerk :System :OrdersDB 12345678:Order 23456789:Order :Inventory<br />

1: getOrderNbr():int<br />

2: return 12345678<br />

3: getOrder(ordernbr.int):Order<br />

4: return Order 12345678<br />

5: displayOrder(Order):void<br />

6: getItem():int<br />

7: return item #1<br />

8: getProdSerialNbr(itemnbr:int):int<br />

9: return prodserialnbr 27<br />

10: [item found] getProduct(prodserialnbr:int):boolean<br />

11: return true<br />

12: [product found] fillitem(itemnbr:int):Product<br />

13: return Product 123<br />

14: reduceinv(prod:Product):boolean<br />

15: return true<br />

Figure 17-6 Complete the sequence of messages.<br />

In Figure 17-6, you can also see the object activations, the narrow vertical rectangles on<br />

the timelines. The object activations indicate when each object is busy. Typically the activation<br />

begins when a message hits the timeline and ends when the response is sent back. In<br />

the case of the system object, the activation runs the entire length showing that the system<br />

is overseeing the entire set of interactions. This is sometimes referred to as the focus of<br />

control.

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

Saved successfully!

Ooh no, something went wrong!