Assignment
5 Design
Due date:
Tuesday 4/20/04 by 4:00pm
Hand in printed copies: Design documents as specified by the website
(we’re doing the official design format this time)
Notes and hints:
- I
especially encourage people to work together on this assignment. It’s quite big, and it’s a cool enough
program to be really worth getting it to work. If you want to work with someone, print out a collaboration
form from the website and bring it to me for signing. If you want me to match you up with
someone, email me and I’ll pair people up. Partners can turn in just one copy of a design.
- The
web page describing this assignment is rather extensive. If you run the sample program and read
through all the information, the ideas will start to come together. In particular, don’t miss the two links
labeled:
Additional
documentation
Interfaces
and Event-Driven Programming
They contain extra information that
will be very helpful for understanding how everything is supposed to work.
- As the
website says, your design must include inheritance. We haven’t gone over inheritance in
detail yet, but you don’t need to know details to plan this. There are two classes that are similar
enough that you should make a superclass for them that contains the things
they have in common. They can both
extend this superclass and inherit that common stuff, so you don’t have to
write it twice. The rest of the
classes in the program can be totally unrelated to this inheritance
hierarchy.
- A good
design for this program will have around 6-8 classes. Here are the kinds of things that might
be represented by these classes:
- Actors—moving
characters in the game
- Groups
of actors—ones who could be treated as a whole instead of individually
- Data
representations—how will you store locations? the board layout?
- The
game itself—the main class, of course
- When
you do your detailed class descriptions, you don’t have to list basic
accessors among your methods.
Let’s just assume that you’ll write an accessor for any private
data member that you find you need access to.