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.

14 Connie’s <strong>Convenience</strong> <strong>Store</strong> Selecting Problem-Domain Objects<br />

(Note: a register consists of a number of data entry devices: a mag stripe reader, an<br />

item scanner, a keypad, and a receipt printer. You don’t need these in your object<br />

model; all of these are just data entry device “nuts and bolts.”)<br />

Kinds of things, too<br />

You might be interested in categories of items, such as:<br />

– perishability: perishable, nonperishable<br />

– taxability: taxable, nontaxable<br />

– type: dairy, produce, canned goods, frozen foods.<br />

Should you add some additional classes, representing these different kinds of<br />

items?<br />

Here’s how. For each category, consider the following:<br />

– If you don’t care about the distinction, forget about it.<br />

– If all you care about is the category value, add an attribute.<br />

– If a category implies added attributes, then add a specialized class; put<br />

the added attributes in it.<br />

– If a category implies different services, then add a specialized class; put<br />

the added services in it.<br />

In this case, based upon the system features, you don’t really care about the distinctions.<br />

Just add item, for now.<br />

Descriptive things<br />

#19. “Select Items and Specific Items” Strategy selecting objects (pattern players)<br />

• Look for items, descriptive objects with values that apply to some number of specific<br />

items and actions that apply across those specific items.<br />

• Examples: aircraft–specific aircraft, loan description–specific loan, job<br />

description–specific job, video description–videotape, price category item–specific item,<br />

tax category item–specific item.<br />

What kinds of catalog descriptions or descriptive tables of values do you need to do<br />

business?<br />

In this system, it’s tax tables. Yuck!<br />

Anyway, you really do have to keep track of tax categories, and the taxable rate that<br />

applies for each one. Add a tax category object, so you can keep track of each category,<br />

its rate, and its effective date. Add your “tangible things” and “descriptive things” to<br />

your object model (Figure 1–6):

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

Saved successfully!

Ooh no, something went wrong!