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.

Establishing Human Interaction Responsiblities Connie’s <strong>Convenience</strong> <strong>Store</strong> 69<br />

Add windows and reports to the human interaction component (Figure 1–44):<br />

HumanInteraction<br />

CashierDrawerWindow<br />

CashierReport<br />

CashierWindow<br />

ItemReport<br />

ItemWindow<br />

LogonWindow<br />

Receipt<br />

RegisterWindow<br />

SaleWindow<br />

<strong>Store</strong>AssessmentWindow<br />

<strong>Store</strong>Report<br />

<strong>Store</strong>Window<br />

TaxCategoryWindow<br />

UPCWindow<br />

LogonWindow<br />

<strong>Store</strong>Window CashierWindow<br />

TaxCategoryWindow<br />

<strong>Store</strong>AssessmentWindow<br />

Receipt<br />

UPCWindow ItemWindow<br />

SaleWindow<br />

Figure 1–44: Select human interaction windows and reports.<br />

ESTABLISHING HUMAN INTERACTION RESPONSIBILITIES<br />

Responsibilities for windows<br />

RegisterWindow<br />

<strong>Store</strong>Report CashierReport ItemReport<br />

CashDrawerWindow<br />

How to model a window effectively<br />

In an object model, a window knows what it holds: its components and its screen layout.<br />

Consider a window’s components. A window may contain many objects, including<br />

views, panes, edit fields, list boxes, menus, buttons, and the like. These objects all work<br />

together to create the effect of one large object, a window.<br />

You could build a rather large and complex model for each window. But why? Face<br />

it: the tool of choice for building windows in most applications is a GUI builder, one<br />

that generates C++ or Smalltalk code. (The only time you would write something yourself,<br />

with the help of some graphic class libraries, is when you are building an application<br />

that requires some specialized graphics manipulation.)<br />

A far better approach? Here it is:<br />

– In your object model, establish what each window knows and does.<br />

– While working with your GUI builder, select mechanisms (views, panes,<br />

edit fields, list boxes, menus, buttons, and the like) so that a window fulfills<br />

its responsibilities.

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

Saved successfully!

Ooh no, something went wrong!