20.02.2013 Views

Connie's Convenience Store - About Peter Coad

Connie's Convenience Store - About Peter Coad

Connie's Convenience Store - About Peter Coad

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.

Working Out Data-Management Dynamics with Scenarios Connie’s <strong>Convenience</strong> <strong>Store</strong> 89<br />

Begin with a search need from the PD component.<br />

Here, consider a search need from a PD object:<br />

store.getCashierForID<br />

store.getItemForUPC.<br />

Work out the dynamics for interacting with DM objects.<br />

Scenario: get cashier for number<br />

Here you go again. For this scenario, you need a “cashier DM” object. That object<br />

knows how to use the local file system to efficiently find the cashier object for the<br />

number. Here is the scenario view (Figure 1–62):<br />

<strong>Store</strong><br />

Figure 1–62: The “get cashier for number” scenario view.<br />

Note that the basic search service, one that all DM objects provide, is made specific<br />

in the scenario view, using “search on .”<br />

Scenario: get item for UPC<br />

This time, you’ll need an “item DM” object.<br />

The item DM knows how to use the local file system to efficiently find the item object<br />

for the UPC.<br />

Here is the scenario view (Figure 1–63):<br />

<strong>Store</strong><br />

CashierDM<br />

getCashierForNumber searchOnNumber<br />

getCashierForNumber store.getCashierForNumber (number ; cashier)<br />

searchOnNumber<br />

ItemDM<br />

getItemForUPC searchOnUPC<br />

Scenario: get item for UPC.<br />

Scenario constraint:<br />

0.1 seconds, 9 out of 10 times,<br />

0.5 seconds max.<br />

getItemForUPC store.getItemForUPC (upc ; item)<br />

searchOnUPC<br />

Scenario: get cashier for number.<br />

Scenario constraint:<br />

0.1 seconds, 9 out of 10 times,<br />

0.5 seconds max.<br />

cashierDM.searchOnNumber (number ; cashier)<br />

itemDM.searchOnUPC (upc ; item)<br />

Figure 1–63: The “get cashier for id” scenario view.

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

Saved successfully!

Ooh no, something went wrong!