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 23—Applying the Extended Statechart Features to the Case Study 241<br />

:Order<br />

ProcessingClerk<br />

1:Order()<br />

:Order<br />

:Product<br />

2:return Order<br />

Inventoried<br />

3:sell(Order)<br />

Inventoried<br />

sell(Order)<br />

4:return true<br />

5:addProduct(Product)<br />

Sold<br />

Sold<br />

6:return true<br />

Figure 23-5 Finding the transition events and candidate states for Scenario 3<br />

In the fourth scenario, shown in Figure 23-6, the product is packed for shipment. But<br />

before the product may be packed for shipping it must have been sold. The pack event<br />

requires the shipment to update the product with the Shipment information so that we can<br />

track it. <strong>To</strong> show the change, I model a transition from the sold state to a new state labeled<br />

Packaged.<br />

:ShippingClerk :Shipment :Product<br />

1:Shipment()<br />

2:return Shipment<br />

Sold<br />

3:pack(Shipment)<br />

Sold<br />

pack(Shipment)<br />

Packaged<br />

4:return true<br />

Packaged<br />

5:addProduct(Product)<br />

6:return true<br />

Figure 23-6 Finding the transition events and candidate states for Scenario 4

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

Saved successfully!

Ooh no, something went wrong!