Homework 3

(15 points)


This assignment is a chance to learn a bit about the Java Swing package, and explore some of the design issues involved in structuring programs around models and views.  It is also a chance to gain some experience designing classes and figuring out how to distribute code in a class hierarchy.  In this assignment, you'll construct the model and view part of a graphics drawing program.  Next time, we'll extend the program to add a controller.

There is no starter code this time, but you'll find several useful examples posted on the class calendar and in Lab #3.

The goal is that when the program runs, a frame will be displayed with a number of shapes drawn on it.  (See the shapes below).

Class Organization

Organize your code using a model-view pattern similar to the one explained in the examples done in class.  The main difference is that you must  include an abstract class to represent generic shapes, and create specific shapes by extending that class.  The abstract class gives you a place to put code that is common to all shapes, without having to duplicate it in each specific class.

Your code should be organized using the following classes and interfaces:

Don't forget...

Make sure you have documented your public interfaces well.  Remember, you are building these classes from scratch.  No one has any idea of what they do except you.  You need to communicate these ideas to the reader.

Written Report (typed as a pdf file):

You must turn in a short typed report that discusses your program, describes the class design, and discusses issues you encountered while working on it.  Your report should cover
  1. Planning: How did you plan and organize your program?  What does it do?
  2. Implementation: How is your program organized?  What are the major classes?  How do the objects interact? Draw a diagram.
  3. Testing: How did you test your code?  What sort of bugs did you encounter?  Are there any unresolved problems in the code?
  4. Evaluate this project.  What did you learn from it?  Was it worth the effort?  This could include things you learned about specifications and interfaces, design issues, Java language issues, debugging, etc.

Turn in your report as a pdf file along with your java files on the turn-in page.