Keywords: current

Next: 1.5.1 The Design Recipe Up: 1. From C++ to Previous: 1.4.6 Singleton Pattern

# 1.5 Basic Program Design

In the preceding sections of this monograph, we studied a Java subset suitable for explicating the basic principles of Java program design. The process of program design can be broken down into six steps:

- Data Analysis and Design
- Contract and Header
- Examples
- Template
- Body
- Test

which we collectively call the design recipe. Let us examine each of these six steps in the context of writing object-oriented programs in Java.

Subsections

- 1.5.1 The Design Recipe
  - 1.5.1.1 Data Analysis and Design
  - 1.5.1.2 Contract and Header
  - 1.5.1.3 Examples
  - 1.5.1.4 Template
  - 1.5.1.5 Body
  - 1.5.1.6 Test
- 1.5.2 An Extended Example: Lists
- 1.5.3 Singleton Pattern
  - 1.5.3.1 Type Predicates and Type Casts in Java
  - 1.5.3.2 Avoiding the Use of the `instanceof` test
  - 1.5.3.3 Maintaining Sample Test Data
  - 1.5.3.4 A Sample Program
- 1.5.4 Inheritance and the Composite Pattern
  - 1.5.4.1 Overriding `equals`
- 1.5.5 Helper Methods, Packages, and Visibility