Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
128<br />
EXAMPLE 9.1<br />
A robot is required to find specific brands of pop cans using a black-and-white<br />
camera and to return the cans to a recycling location. Such a statement can be the<br />
user-oriented requirements and consists of a phenomenon from the environment.<br />
However, the pop cans are hidden phenomenon in the environment. That is, the<br />
implementation will not know about pop cans; it will know about black-and-white<br />
images of pop cans. This is the visible phenomenon. When the specification that<br />
will be used as the starting point for design is written, it needs to talk in terms of<br />
these images. It will be assumed (and may need to be verified) that only real pop<br />
cans will give those images. For example, the problem will be much more difficult if<br />
the walls of the environment are covered with ads that contain images of pop cans.<br />
EXAMPLE 9.2<br />
Identify which phenomenon is in the environment and which is in the<br />
implementation in the library system.<br />
The physical book is an environment-hidden phenomenon. The system never<br />
knows about the book. When the librarian scans the book, he or she is really<br />
scanning a bar code. This bar code is not the ISBN but has to reflect possible<br />
multiple copies of a single book. This bar code is environment-visible. The<br />
implementation probably uses a different identifier or pointer for the book data. This<br />
internal identifier is implementation-hidden.<br />
The specification for development needs to be written in terms of the bar code<br />
on the book. Neither the physical book nor the internal identifier should be<br />
mentioned in the development specification.<br />
9.2 Phases of the DesignProcess<br />
The following are phases in design:<br />
TEAMFLY<br />
CHAPTER 9 Software Design<br />
Data design—This phase produces the data structures.<br />
Architectural design—This phase produces the structural units (classes).<br />
Interface design—This phase specifies the interfaces between the units.<br />
Procedural design—This phase specifies the algorithms of each method.<br />
EXAMPLE 9.3<br />
Design the library classes/data structures from the data items in the object model<br />
shown in Fig. 9-1 for the library problem (see Examples 8.1 and 2.6).<br />
The data design and the architectural phases have been combined in this<br />
example. The concentration in this example is on the loan and checkout<br />
functionality, with little regard for the other necessary tasks, such as administration,<br />
cataloging, assigning overdue fines, retiring books, and patron maintenance.<br />
The domain entity ‘‘book’’ is probably not going to continue into the design. It will<br />
be combined with ‘‘copy’’ into a class/data structure that stores all the information<br />
about a copy. It will probably use the ISBN and a copy number as the unique<br />
identifier. The patron information will be stored in a second data structure. Each<br />
record is probably identified by an unique patron ID number. The loan information<br />
may or may not be a separate data structure. If borrowing information needs to be<br />
saved beyond the return of the book, then it had better be a separate class/data