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.

26 Connie’s <strong>Convenience</strong> <strong>Store</strong> Applying Patterns: Select and Organize Problem-Domain Objects<br />

#6. “Transaction–Transaction Line Item” Pattern transaction patterns<br />

Transaction<br />

number<br />

date<br />

time<br />

status<br />

aboutMe<br />

howMany<br />

howMuch<br />

rankLineItems<br />

calcOverLineItems<br />

calcForMe<br />

• Typical object interactions<br />

howManyOverInterval —> calcForMe calcOverLineItems —> calcForMe<br />

howMuchOverInterval —> calcForMe rankLineItems —> rateMe<br />

• Examples<br />

Transaction: agreement, assignment, authorization, contract, delivery, deposit,<br />

incident, inquiry, order, payment, problem, report, purchase, refund, registration,<br />

rental, reservation, sale, shift, shipment, subscription, time charge, title,<br />

withdrawal.<br />

Transaction–transaction line item: deposit–deposit line item; order–order line item;<br />

payment–payment line item; rental–rental line item; sale–sale line item;<br />

shipment–shipment line item; withdrawal–withdrawal line item.<br />

• Combinations<br />

participant-transaction; place-transaction; specific item–transaction;<br />

transaction–subsequent transaction; transaction line item–subsequent transaction<br />

line item; item–line item; specific item–line item.<br />

Connect a sale and its parts, sale line items, in your model (Figure 1–15):<br />

Figure 1–15: Sale-sale line item.<br />

Note that a sale object knows one or more sale line item objects.<br />

Sale<br />

1-n<br />

1<br />

SaleLineItem<br />

1-n 1<br />

TransactionLineItem<br />

number<br />

date<br />

time<br />

status<br />

aboutMe<br />

calcForMe<br />

rateMe

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

Saved successfully!

Ooh no, something went wrong!