Assignment 0 Design Exercise FAQ

A) There are a lot of instructions here. What exactly do I have to DO?

You have to answer the four questions at the very end of the assignment page. To summarize them:

  1. Describe the transfer hubs and bus routes that you're modeling. (See question B.)
  2. Name four classes that your model needs (see question C), and describe the data members and methods they have (see question D).
  3. Draw class diagrams for each of the classes you described. (See your notes and the book for exactly how to make the diagrams.)
  4. Write three quick answers to questions about IDEs. (This part is sort of unrelated to the rest of the assignment.)
Now read through the rest of the assignment again. There are places that kind of make it sound like you have to do more than this, but keep these four questions in mind, because they're all you have to do.

B) Do I actually have to know anything about the Madison bus system to do this?

You only need to get a little info off the metro website. Modeling the entire bus system of Madison is only your "pretend" goal in this assignment. Your real goal is to visualize a small piece of the system, so that you have something concrete but small to look at while you're designing your classes.

Basically, pick two hubs and a couple of ordinary routes that go between them. Then draw a diagram of them, or write a description. Now you have a mini-system.

C) How can I figure out what classes I should have?

Take a look at your mini-system. Most of the "things" in it could be represented by objects in a computer program. When you're writing your classes, keep looking back at this mini-system and make sure you could represent everything in it using objects made from those classes.

For example, suppose you had drawn a bunch of little buses along the routes in your mini-system. One of the four classes you're supposed to have is the Bus class; the assignment gives this one to you already. Note that it would be possible to make an object of the Bus class to represent each of the little buses in your drawing. This should make you happy.

There are more than four possible classes, but you're supposed to pick the four that you think are the most important. Yours might be different from the ones that someone else chooses, and that's fine.

D) How can I figure out what data and methods my classes should have?

Do the Bus class first, since the assignment already tells you what should go into that class. Describe very briefly what each data member represents and what each method does. Ignore those + and - signs in the diagram.

Then go to another class. Think about what information each object of that class should have, and create corresponding data members. Decide if any of these should be class data members instead of instance data members. (For the Bus class, the designer decided that "maxCapacity" should be a class data member, because every bus would have the same maximum capacity.)

Then think about what an object of that class should be able to do, and create corresponding methods. Again, decide if any of these should be class methods instead of instance methods. (For the Bus class, it seems like the method "getCapacity()" is supposed to return the maximum capacity... and if so, I think the designer should have made it a class method, because it uses a class data member. In fact, go ahead and underline it to show that it's a class method. While you're at it, rename it "getMaxCapacity()", because that's a better name.)

Look under the section labelled "Analysis" in the assignment for a list of the information that should exist somewhere in your system.

E) How is this going to be graded?

The most important thing is that you have classes, data, and methods that make sense in the system. There isn't a set of ultimate right answers, so don't agonize too much over the details. The idea is to show that you understand classes and objects and can apply them to a specific situation. You will be graded based on how well you appear to understand. (Clear explanations of your answers will therefore help.)