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 6—Building the Use Case Diagram 67<br />

This example does not have a reason to use the stereotype. But suppose<br />

that the users want the flexibility to add a product into inventory right off the truck,<br />

without placing it into one of the predefined locations. In essence, they would bypass the<br />

StockProduct Use Case. This bypass would only be used with manager-level authority. In this<br />

situation, ReceiveProduct would only call the Update Inventory extension if the manager<br />

approval were provided to do so. Figure 6-6 models the extend relationship.<br />

Receive Product<br />

<br />

Update Inventory<br />

Figure 6-6 An example of dependency<br />

Watch out for the direction of the arrows; it is easy to get them reversed. Read the<br />

dependency in Figure 6-6 as “UpdateInventory extend(s) (is used with) ReceiveProduct if<br />

the extension point condition is met in ReceiveProduct.”<br />

Step 8: Evaluate the actors and Use Cases for generalization<br />

In Session 5, you saw that generalization is a tool for organizing similarities and differences<br />

among a set of objects (like actors or Use Cases) that share the same purpose. Review the<br />

diagram for opportunities to apply the generalization concept.<br />

The problem statement told us that, “The products may come from cancelled orders,<br />

returned orders, or vendor shipments.” If the stocking rules are significantly different for<br />

the various types of incoming stock, you could use generalization on the StockProduct Use<br />

Case, as shown in Figure 6-7.<br />

Stock Product<br />

Stock New<br />

Product<br />

Stock Returned<br />

Product<br />

Stock Cancelled<br />

Order Product<br />

Figure 6-7 Using generalization to identify differences within a type of Use Case<br />

Figure 6-7 shows that StockNewProduct inherits all the rules from StockProduct and<br />

then adds some variations unique to stocking new products. The same is true for<br />

StockReturnedProduct and StockCancelledOrderProduct.

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

Saved successfully!

Ooh no, something went wrong!