Programming and Problem Solving with Java

(やまだぃちぅ) #1

(^286) | Object-Oriented Software Design and Implementation
Hierarchical Solution Tree
Solve the problem
Abstract
Concrete
Level 0
Level 1
Level 2
Level 3
To p
Bottom
Step A
Step B
Step C Step E
Step F
Step 1
Subproblem I
Subproblem A Subproblem B
Subproblem 2
Subproblem C Subproblem F
Subproblem II Subproblem III
Step I
Step II
Step III
Figure 6.7 Hierarchical Solution Tree
When a responsibility clearly involves a series of major steps, we break it down (de-
compose it) into pieces. In the process, we move to a lower level of abstraction—that is, some
of the implementation details (but not too many) are now specified. Each of the major steps
becomes an independent subproblem that we can tackle separately. The process continues
until each subproblem cannot be divided further or has an obvious solution.
By subdividing the problem, you create a hierarchical structure called a tree structure. Each
level of the tree is a complete solution to the problem that is less abstract (more detailed) than
the level above it. Figure 6.7 shows a generic solution tree for a problem. Steps shown in
black type have enough implementation details to be translated directly into Java state-

Free download pdf