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.

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

That’s four object-model components. There is a fifth one. It’s the “not this time”<br />

component. It’s a bucket that holds objects that are interesting, ones that you consider,<br />

yet that for one reason or another (be it technical, sociological, or economic), you’ve<br />

decided not to include at this time. By using this component along with the others, you<br />

can show what’s included—and what’s not.<br />

By organizing classes this way, you facilitate simpler modeling this time (within<br />

each model component).<br />

You also increase the likelihood of reuse next time. Why? Here’s an example. Next<br />

time, you might want to reuse certain problem domain classes, even though you may<br />

choose to work with different human interaction classes.<br />

What’s the alternative? Smash the model components together. But then the overall<br />

model is harder to understand; and in the future, unless you choose the same problemdomain,<br />

human-interaction, data-management, and system-interaction approach, reuse<br />

is very unlikely. Ouch!<br />

So, use model components. Use them as an overall outline, a guide for selecting objects.<br />

And use them to keep your classes well-organized, for understanding, and for<br />

reuse (Figure 1–3):<br />

ProblemDomain HumanInteraction<br />

SystemInteraction NotThisTime<br />

Figure 1–3: Model components.<br />

You can use these model components to organize your approach to building the<br />

model.<br />

In this chapter, you’ll go from PD to HI to DM to SI. In each case, you’ll use strategies<br />

and patterns to help you:<br />

– select objects<br />

– establish responsibilities<br />

– work out dynamics with scenarios.<br />

SELECTING PROBLEM-DOMAIN OBJECTS<br />

DataManagement<br />

Take a walk on the wild side inside Connie’s <strong>Convenience</strong> <strong>Store</strong>. Look for objects, one<br />

that the system might need to know or do something about.<br />

Coming up, you’ll apply strategies for selecting objects:<br />

– actors and participants<br />

– places<br />

– things.<br />

For now, consider PD objects. (Later in this chapter, you’ll consider HI, DM, and SI<br />

objects, too.)

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

Saved successfully!

Ooh no, something went wrong!