Connie's Convenience Store - About Peter Coad
Connie's Convenience Store - About Peter Coad
Connie's Convenience Store - About Peter Coad
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
86 Connie’s <strong>Convenience</strong> <strong>Store</strong> Selecting Data-Management Objects and Resposibilities<br />
Scenario: authorize payment<br />
Here is the scenario view (Figure 1–60):<br />
Check<br />
authorize getAuthorization<br />
AuthorizationServer AuthorizationSystem<br />
getAuthorization<br />
getAuthorization<br />
authorize check.authorize ( ; result)<br />
getAuthorization<br />
AuthorizationSystemSI<br />
connect<br />
authorize<br />
disconnect<br />
connect<br />
authorize<br />
disconnect<br />
Figure 1–60: The “authorize payment” scenario view.<br />
SELECTING DATA-MANAGEMENT OBJECTS AND RESPONSIBILITIES<br />
Data-management (DM) objects are an important part of an object model.<br />
Scenario: authorize payment.<br />
Scenario constraints:<br />
5.0 seconds, 9 out of 10 times,<br />
20.0 seconds max.<br />
authorizationServer.getAuthorization<br />
(check ; result)<br />
authorizationSystem.getAuthorization<br />
(check ; result)<br />
authorizationSystemSI.connect (; result)<br />
authorizationSystemSI.authorize (; result)<br />
authorizationSystemSI.disconnect (; result)<br />
#32. “Select Data Management Objects” Strategy selecting objects (model components)<br />
• Add a DM object for each problem-domain class of objects that you want to be<br />
persistent—stored between program invocations.<br />
• Why: use data management (DM) objects to encapsulate search and storage mechanisms<br />
across all of the objects within a problem-domain class.<br />
• Examples: cashier DM, sale DM, sale line item DM, item DM.<br />
Each DM class has just one object in that class. That object knows its corresponding<br />
PD objects, and is responsible for taking care of the data management needs across<br />
that collection of objects.<br />
Here’s what DM objects know and do:<br />
– Each DM object knows all of the objects in a corresponding problemdomain<br />
class.<br />
For example, a cashier DM object knows about all of the cashier<br />
objects.<br />
– Each DM object knows how to search.<br />
You can ask it to search for objects that you need.<br />
– Each DM object knows how to load and save.<br />
It loads and saves the problem domain objects it knows about.<br />
It usually does this if the underlying storage mechanism is not objectoriented.