Here we are, the class diagram.
As you can see this is the class diagram. The Game class is pretty big. We expected this from last time when we made a list of it's responsibilities. Let's go over some anatomy of the class diagram. At the top in bold is the name of the class. The next section shows it's attributes, or what it knows. Game collaborates with Stand and Word by getting information from them that's why there's a variable for those in this section. The third section are it's methods or functions. They are all the things the class does.
If you look at the Stand class it's method drawNext() has a plus (+) in front of it. That plus indicates that the method is public. It's public so that Game can call it. Stand's integer called stage has a minus (-) in front of it. That means private. No one but Stand
Umbrello, yours may look different depending on what tool you used.
needs to know what stage it's on they just need to be able to tell stand to do it's thing. All of game's attributes are private since it's the driver of the game. This diagram was made with
|
Hangman class diagram |
All those methods were fleshed out as I went through the use cases to verify that all the responsibilities were represented. When we go over the next set of diagrams it'll make more sense how I came up with all these methods. Until then, happy diagramming.