1
In order to practice APOO I am trying to apply use cases to a simple game of guessing a color.
Here it would be it visually. The user can try to guess as many times as he wants, or restart the game by clicking on "Reset".
Although simple, it seems to fit three use cases here:
Start game
- Game secretly chooses a random color from three available.
- Game displays neutral color (gray).
Play game
Precondition: game started
- Player chooses one color from three available.
- Game displays chosen color.
- If color equal to hidden, informs that the player has won.
- If different color from hidden, informs that the player has lost.
- Player can repeat the move (step 1) as many times as he wants.
Restart
- Player requests start of new game.
- Use case Start Game becomes available.
I have three questions:
Use cases are well (correctly) defined?
Player is an actor (external to the system); game is also an actor? As the use case diagram in this case (would be an actor within the limits of the system, for example)?
In Restart, another use case is called. Actually this use case needs to be called every time the application starts. How do I represent this in the use case diagram? Or is this not correct (it should only be a precondition, for example)?