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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

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

Session and the subsequent transactions<br />

Consider a session object.<br />

A session is a transaction. What are its subsequent transactions? In other words,<br />

what “event remembered,” what significant moment in time occurs after a session?<br />

What follows a session transaction? Hopefully, one or more sales.<br />

What follows a sale transaction? Hopefully, one or more payments.<br />

Connect the objects, using two instances of the transaction–subsequent transaction<br />

pattern (Figure 1–13):<br />

Container-content<br />

Session Sale Payment<br />

Figure 1–13: Session-sale and sale-payment.<br />

#14. “Container-Content” Pattern aggregate patterns<br />

number<br />

name<br />

capacity<br />

aboutMe<br />

n 1 n 1<br />

Container<br />

howMany<br />

howMuch<br />

rankContents<br />

calcOverContents<br />

calcForMe<br />

n 1<br />

Content<br />

number<br />

size<br />

weight<br />

dimensions<br />

aboutMe<br />

calcForMe<br />

rateMe<br />

• Typical object interactions<br />

howMany —> calcForMe calcOverContents —> calcForMe<br />

howMuch —> calcForMe rankContent —> rateMe<br />

• Examples<br />

Containers<br />

airport, aircraft, aisle, bank, bin, building, cabinet, folder, garage, hangar, hospital,<br />

locker, room, safe, store, warehouse.<br />

Container–content<br />

aircraft-cargo; aircraft-passenger; building-room; catalog–catalog item, storeitem;<br />

warehouse–loading dock.<br />

• Combinations<br />

container-content (again); container–container line item; group-member; assemblypart.<br />

Also, when “container” or “content” is a participant, place, or specific item:<br />

actor-participant; participant-transaction; place-transaction; specific<br />

item–transaction; specific line item–line item; item–specific item.

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

Saved successfully!

Ooh no, something went wrong!