Java Reference
In-Depth Information
536
12.2 Discovering Classes
In the design phase of software development, your task is to discover structures that
make it possible to implement a set of tasks on a computer. When you use the
object-oriented design process, you carry out the following tasks:
1.
Discover classes.
2.
Determine the responsibilities of each class.
3.
Describe the relationships between the classes.
In object-oriented design, you discover classes, determine the responsibilities of
classes, and describe the relationships between classes.
A class represents some useful concept. You have seen classes for concrete entities,
such as bank accounts, ellipses, and products. Other classes represent abstract
concepts, such as streams and windows. A simple rule for finding classes is to look
for nouns in the task description. For example, suppose your job is to print an invoice
such as the one in Figure 4 . Obvious classes that come to mind are Invoice ,
LineItem , and Customer . It is a good idea to keep a list of candidate classes on a
whiteboard or a sheet of paper. As you brainstorm, simply put all ideas for classes
onto the list. You can always cross out the ones that weren't useful after all.
Search WWH ::




Custom Search