This assignment has four objectives. You will:
  1. Learn about software design reuse by studying a provided framework for problem solving that has abstracted the general features of the bridge crossing program from the previous assignment.
  2. Adapt your bridge crossing program to work with the framework.
  3. Apply the framework to allow users to solve a new problem, the "Water Jug" problem.
  4. Write your own test classes for unit testing of the water jug problem program.
Upon completion, this assignment will have two working programs: Applets showing the behavior of these programs follow.
(Note: to restart the applet below, simply reload this page and select Bridge from the menu on the left.)

(Note: to restart the applet below, simply reload this page and select Water Jug from the menu on the left.)

Frameworks consist of generally useful code that can be used with more than one application.

This section briefly describes the motivation behind frameworks, the elements typically contained in frameworks, and how frameworks contribute to code reuse.

Frameworks often arise from the realization that separate program applications have similar structure.

For example, in both the bridge crossing and water jug problems,

Examining two separate implementations of these problems would reveal repeated code.

A framework manages repeated code so that it can be shared among multiple applications.

The problem solving framework you will use consists of an interface, two abstract classes, and a concrete class.
  1. Study the provided framework classes to understand their function
  2. Refactor your bridge crossing code to work with the framework
  3. Develop classes to implement the water jug problem
  4. Develop classes to test the water jug implementation classes
The implementation and test classes have been started for you.
The source code for the implementation packages is described in this section.
This section describes the tests to be used in unit testing for this assignment.
When your program is working correctly you will submit your entire Netbeans project, but first: Outside of NetBeans, zip your project folder as your-login-PA2.zip.

Email the zip file to your TA.