[PLT logo] TeachJava!

The Java Design Recipe

  1. Define the data.
  2. For each program operation, determine the form of data processed by the operation. Include a method for the operation in the class(es) defining that form of data.

  3. For each such method, write a contract specifying what the operation requires and what it produces.

  4. For each program operation, give a collection of examples specifying how you expect that operation to behave. Write these examples as test cases in the main method of the class containing the operation.

  5. For each program operation select an appropriate template, recognizing that self references in the class of the method suggest that recursive delegation is appropriate.

  6. Test each method using the the examples from step 4 and additional examples suggested by issues that arose during coding.