Connie's Convenience Store - About Peter Coad
Connie's Convenience Store - About Peter Coad
Connie's Convenience Store - About Peter Coad
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
42 Connie’s <strong>Convenience</strong> <strong>Store</strong> Establishing Responsibilities for Problem-Domain Objects<br />
#58. “Describe Attributes with establishing responsibilities /<br />
a Template” Strategy what I know (descriptions)<br />
• Describe each attribute, using a template as your guide.<br />
description<br />
legal values (range; limit; enumeration of values)<br />
unit of measure<br />
data type<br />
tolerance<br />
required (yes or no)<br />
get/set constraints<br />
how to get a default value from another source, in the event a custom value is<br />
not known<br />
applicable states (for state-dependent attributes)<br />
traceability codes (to a requesting document, if any).<br />
You might choose to write this in natural language; you might choose to write this<br />
in a formal specification language (like Object-Z, if you’re a “zed-head”). Or you might<br />
just want to sketch it out with programming language syntax.<br />
You may as well get in the habit of writing down some short descriptions. And you<br />
may even find some additional attributes and services along the way. (Ah! Some immediate<br />
gratification from doing this grunt work. That would be nice. Read on.)<br />
Work out some attribute descriptions for item’s attributes.<br />
Begin with number and description:<br />
– number: an identifying number, uniquely assigned by Connie’s<br />
required: yes<br />
– description: a name for the item (it may be a brand name)<br />
required: yes<br />
length = 20 characters<br />
– taxable: an indication whether or not this item is taxable<br />
enumeration of values: yes or no<br />
default: yes. 3<br />
Hmmm. Something seems suspicious here.<br />
#61. “Yes/No Attribute” Strategy establishing responsibilities /<br />
what I know (consider and challenge)<br />
• Attribute has values “yes or no?”<br />
The attribute name itself may be a value for some other attribute name<br />
Example: taxable (yes or no); change to tax status (taxable, tax-exempt, resale).<br />
Why bother: added detail now, added ease of change in the future.<br />
3 You’ll see very few attribute or service descriptions like this in this book. Writing descriptions<br />
is pretty straightforward. Reading them is unbelievably boring (and that’s not something for this<br />
book). Nevertheless, for some systems and organizations, detailed attribute (and service) descriptions<br />
are required writing. So be it.