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.

10 Connie’s <strong>Convenience</strong> <strong>Store</strong> Selecting Problem-Domain Objects<br />

Customer<br />

What about the customer? Adding “customer” makes sense only if you have some<br />

way to find out who Connie’s customers are, or at least who some of her customers are.<br />

#47. “Way to Know” Strategy selecting objects (consider and challenge)<br />

• You need a way to know each object—and its attribute values.<br />

• If you have no way to know an object, either find a way to know about it or<br />

put the object in the “not this time” model component.<br />

• Example: customer. You must have a way to know about customer objects;<br />

otherwise, put customer in the “not this time” model component.<br />

If each and every customer comes into a store, participates anonymously, and<br />

leaves again, then there is no reason to have a customer object in an object model.<br />

Why? Because the system would not be responsible to know or do anything about that<br />

customer.<br />

But what if Connie’s new system could know the identity of at least some of her<br />

customers, especially some of her better customers? What then?<br />

How could Connie’s cashiers find out about who their customers are? What could<br />

Connie do to make this happen? She could offer a check guarantee card. Or she could<br />

launch a special “frequent shopper” program. Either way, Connie could issue cards with<br />

machine-readable codes. The cashier (or even the shopper) could run the card through a<br />

scanner.<br />

Connie could use that information to better serve her customers.<br />

This looks like a change in scope. Better check it out with Connie.<br />

(<strong>Peter</strong>) How about a frequent buyer program?<br />

(Connie) Nice idea. But not this time! I’m dealing with enough changes right now.<br />

(<strong>Peter</strong>) Understood. Have a nice day.<br />

(<strong>Peter</strong>, to himself) And don’t be so cranky. Good grief. I’m just doing my job.<br />

Okay, then. To the problem-domain component, add person and cashier. To the “not<br />

this time” component, add organization, customer, and head cashier (Figure 1–4):<br />

ProblemDomain<br />

Cashier<br />

Person<br />

NotThisTime<br />

Customer<br />

HeadCashier<br />

Organization<br />

Person<br />

Figure 1–4: Select actors and participants.<br />

Cashier

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

Saved successfully!

Ooh no, something went wrong!