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 Data-Management Objects and Resposibilities Connie’s <strong>Convenience</strong> <strong>Store</strong> 87<br />

So why are DM objects so doggone important?<br />

– A DM object knows how to store and retrieve objects from whatever storage<br />

mechanism is to be used, whether flat file, indexed, relational, or<br />

object-oriented.<br />

– A DM object isolates data management complexities from the rest of the<br />

application.<br />

It interacts with local data management facilities and storage devices.<br />

When necessary, it interacts with an object that represents another<br />

system, to find objects located on an interacting system.<br />

– A DM object isolates the transition from an object oriented environment<br />

to a nonobject-oriented environment<br />

– And in systems that need such capability, a DM object could cache results<br />

when an interacting system is down.<br />

For searching<br />

If an object needs to search across all the objects in a class, and if no domain-based collection<br />

can be found to hold those objects, then let the object send a message to a DM<br />

object, asking it to do the search.<br />

For persistence<br />

This point-of-sale system also needs for some of its objects to be persistent, remembered<br />

over time, from one execution of the system to the next.<br />

Here’s the approach. If the underlying storage management is not object-oriented,<br />

then add a DM object for each class with objects that need to be persistent.<br />

In this system, just add these DM objects:<br />

– person DM<br />

– cashier DM<br />

– item DM<br />

– register DM<br />

– cash drawer DM<br />

– sale DM<br />

– sale line item DM<br />

– session DM<br />

– store DM<br />

– tax category DM<br />

– upc DM<br />

– price DM<br />

– payment DM.<br />

Each DM object knows its corresponding PD objects.

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

Saved successfully!

Ooh no, something went wrong!