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.
36 Connie’s <strong>Convenience</strong> <strong>Store</strong> Establishing Responsibilities for Problem-Domain Objects<br />
Model it.<br />
Cashier<br />
number<br />
password<br />
authorizationLevel<br />
currentSession<br />
isAuthorized<br />
assessPerfOverInterval<br />
Figure 1–23: Cashier: “what I do.”<br />
Participant: customer<br />
Connie has already decided to hold off on finding a way to know about specific customers.<br />
Yet, what if you had a customer object? It could do some interesting things for you,<br />
though.<br />
#88. “Why, Why, Why” Strategy establishing responsibilities /<br />
what I do (fundamentals)<br />
• Add value by asking “why, why, why?”<br />
Why, why, does the system need this object anyway?<br />
What useful questions can it answer? What useful actions can it perform?<br />
What is done to an actual object, something that this object could do itself?<br />
It’s the active side of objects that’s the exciting aspect; the active side tells you more<br />
about the “why, why, why” of having that object in the object model. A customer object<br />
could:<br />
– tally purchases over interval<br />
– tally purchase rate over interval<br />
– tally number of returns over interval<br />
– tally number of bad checks over interval.<br />
Such services all fall under one important heading, “assess customer” or “qualify<br />
customer.”<br />
Note: “assess” is a stereotypical behavior for a participant; look for “assess” services<br />
whenever you consider the active side of a participant object.<br />
Responsibilities for places<br />
<strong>Store</strong><br />
Why do you need a store object?<br />
Yes, you could keep track of the name, address, and other attribute values for a<br />
store.