Thursday, November 11, 2004 11:16 PM
This is a typical homework question, where the you need to find out what your teacher expected, not what actually would makes sense.
For a real software system, the classes you'd like to have depend on the *behaviour* of the system, and how you can distribute it between objects so that the design is flexible enough to allow cheap modification and reuse of code.
For example, if the system should show a clock to a user on a screen, you could have a Clock, a ClockView and a Timer. The responsibility of the Clock is to do clock arithmetic - to know that a minute has 60 seconds etc. The responsibility of the ClockView would be to show the current time to the user. That way you can exchange the presentation (digital, analog, sound etc.) without having to touch the clock logic in the Clock class. The Timer would tell the clock when another second has passed. Again, you could exchange different implementations without touching the rest of the system (use the system clock, a network time server, whatever). The Timer also allows it to test the other two classes without relying on the real time, by using a Test implementation that you have under full control.
As you can see, I don't have any Hand classes in the above description, because for the system I envisioned, they wouldn't have any behaviour (in fact there would be cases were there aren't any hands). Of course this is just one example for a "clock" system - you could certainly formulate it differently and then you'd need totally different classes. What you probably wouldn't need in either case is a class model that "models the real world".
Telling the above to your teacher probably won't help you (though it might be interesting how he reacts), but I hope it motivates you to take what he teaches with a grain of salt... ;)