Design Recipe

Throughout the course, we will follow a design recipe suitable for object-oriented programming. By having a design process, we hope to reinforce solid design skills, within the context of object-oriented programming, and Java in particular.

The design recipe has two characteristics, chronology and modeling.

Chronology

As we design programs, we are inherently concerned with the order in which things happen. In the most general terms, a program is characterized by:

Input Processing Output
Information is provided to the program, either as keyboard input or loaded from a file on disk The program performs the calculations as demanded by the requirements. Information is output to be either viewed by the user on the console output window or saved to a file on disk

As you discovered in CS1101, the skeletal structure of programs can be made to match the structure of the input.

Modeling

To provide a better understanding of how your program processes its information, we also are concerned with identifying the concepts that will be used throughout the program. The primary advantage of object-oriented design is to use programming concepts such as classes that map directly to the concepts found in the requirements document. Thus, when the input speaks of "reading in a student record", during processing you will create an object-oriented class that represents the student record.

Once the classes are defined, the basic building blocks of the computations become methods on these classes, while fields store information about the state of the computations. The goal of the designer is to decompose the desired processing into a series of method invocations over the objects that are constructed during the input processing phase. Thus, in tandem with the chronology above, object-oriented programs typically exhibit the following behavior:

Input Processing Output
Instantiate objects to represent the information being processed

 

A program invokes various method invocations to mutate or create new objects to represent the changed state Information is extracted from the objects to be delivered either as output to the console or to be saved to a file on disk.

Form Follows Function

We will start with a simplified design recipe. As we tackle more complex problems, and introduce different aspects of the Java language, the design recipe will be revised accordingly.

Computation 10/24 - 10/30 Design Recipe v0
Composition I 10/31 - 11/03  
Composition II 11/07 - 11/10 Design Recipe v1
Classification I 11/13 - 11/20  
Classification II 11/27 - 12/01 Design Recipe v2