Exercise: team games
You are modeling a sports league—it could be any team sport. Certainly one important class is the team, which will have a name (unique within the league), a coach, a home field or venue, and probably more attributes.
• Obviously, teams play games. In each game, there is a designated “home team” and “away team” (even if the game is played at a neutral venue). Teams may play each other more than once during a season, possibly even with the same home and away roles (for example, during playoffs).
• Design a class diagram that shows the teams, the games that they play, and the score of each game. Then draw the relation scheme for your model.
Copyright © 2002–2006, by Tom Jewett. Links to this site are welcome and encouraged. Individual copies may be printed for non-commercial classroom or personal use; however, this material may not be reposted to other web sites or newsgroups, or included in any printed or electronic publication, whether modified or not, without specific permission from the author.