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.
Selecting Problem-Domain Objects Connie’s <strong>Convenience</strong> <strong>Store</strong> 15<br />
ProblemDomain<br />
CashDrawer<br />
Cashier<br />
Item<br />
Person<br />
Register<br />
Item<br />
Register<br />
<strong>Store</strong><br />
TaxCategory<br />
TaxCategory CashDrawer<br />
Figure 1–6: Select tangible things and descriptive things.<br />
<strong>About</strong> transactions as things<br />
What’s a transaction, in the context of building an object model?<br />
A “transaction” is a recording or logging of any event of significance; hence, you<br />
could call it “a significant event remembered.”A “transaction object” knows about a<br />
significant event, knows who the players are in that event, and calculates things pertaining<br />
to that event.<br />
#17. “Select Transactions” Strategy selecting objects (pattern players)<br />
• Look for transactions, “events remembered,” events that the system must remember<br />
through time. A transaction is a moment in time (for example, a sale) or an interval of<br />
time (for example, a rental).<br />
• Look for an entry in a historical record or log, an entry that must be maintained. Why? To<br />
answer questions or to perform assessments.<br />
• Examples: agreement, assignment, authorization, contract, delivery, deposit, incident,<br />
inquiry, order, payment, problem report, purchase, refund, registration, rental,<br />
reservation, sale, shift, shipment, subscription, time charge, title, withdrawal.<br />
• Note: Nearly all transactions consist of a number of transaction line items.<br />
• Note: Where do these transactions come from? The possibilities are:<br />
A window (the event logged is based upon human interaction at some point in time)<br />
Another object, monitoring for a significant event, then logging that such an event<br />
occurred<br />
Another system, one that your system can interact with regarding events it logs.<br />
So the question is: what are the transactions, the notable events that must be<br />
recorded by your system?<br />
Consider Connie’s <strong>Convenience</strong> <strong>Store</strong>. What significant transactions, events remembered,<br />
occur every day? How about:<br />
– sale<br />
– payment (a companion to any sale at Connie’s)<br />
– session (from logon to logoff).