Workshop
To review what you've learned about object-orientation, try your hand at these quiz questions. The answers appear in Appendix A, "Quiz Answers."
Quiz
How do you represent a class in the UML?
What information can you show on a class icon?
What is a constraint?
Why would you attach a note to a class icon?
Exercises
-
Here's a brief (and incomplete) description of hockey:
-
If you know more about basketball than I've put in Figure 3.15, add information to that diagram.
-
Go back to the conversation between the analyst and the basketball coach. Take a look at the coach's responses and find at least three areas where you could pursue additional lines of questioning. For example, at one point the coach mentions a "three-point line." Further questioning would reveal the specifics of that term.
-
Here's a preview of what's next: If you had to draw some connections among the classes in Figure 3.15, what might they look like?
A hockey team consists of a center, a goalie, two wings, and two defensemen. Each player has a stick, which he uses to advance a puck on the ice. The objective is to use the stick to shoot the puck into a goal. Hockey is played on a rink with maximum dimensions of 100 feet wide by 200 feet long. The center's job is to pass the puck to the wings, who are typically the better shooters on the team. The defensemen try to stop the opposing players from getting into position to shoot the puck into the goal. The goalie is the last line of defense, blocking opposition shots. Each time he stops the puck from getting into the goal, he's credited with a "save." Each goal is worth one point. A game lasts 60 minutes, divided into three periods of 20 minutes each.
Use this information to come up with a diagram like the one in Figure 3.15. If you know more about hockey than I've put in the description, add that information to your diagram.