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

Create successful ePaper yourself

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

80 Connie’s <strong>Convenience</strong> <strong>Store</strong> Working Out Human-Interaction Dynamics with Scenarios<br />

Hold it! A sale window needs to know its values for a payment. Add a payment attribute.<br />

“Complete the sale” scenario<br />

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

SaleWindow<br />

endSale open<br />

updateBalance<br />

Figure 1–55: The “complete the sale” scenario view.<br />

Scenario: log off<br />

One more time.<br />

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

SaleWindow<br />

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

endSale saleWindow.endSale<br />

open<br />

updateBalance<br />

Session<br />

logoff endSession<br />

logoff saleWindow.logoff<br />

endSession<br />

addSale<br />

addSale<br />

Figure 1–56: The “log off” scenario view.<br />

Scenario: actual cashier logs off.<br />

Scenario constraint:<br />

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

1 second max.<br />

session.endSession<br />

Scenario: completes the sale.<br />

Another service! Add “end session” to session.<br />

Way to go! This object model is really beginning to take shape.<br />

Scenarios drive you to significant detail—and better object models. Cool!<br />

Scenario constraint:<br />

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

0.5 seconds max.<br />

cashDrawer.open<br />

cashDrawer.updateBalance (total ; )<br />

store.addSale (sale ; )

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

Saved successfully!

Ooh no, something went wrong!