- I have these uml diagrams. They are diagrams of a game called Tictactoe. Just a simple tictactoe with scoring. So i would like you to check or give an opinion of my diagrams if it is correct or needs improvements.
- here are the diagrams:
Acitivity diagram Class diagram Usecase diagram Statechart diagram
Simple answer: the diagrams are incorrect.
Without even looking at the problem-domain aspects of the diagrams, there are glaring problems.
1) Your activity diagram cannot possibly work. All incoming connections must offer tokens before an action can start; thus, SwitchCurrentPlayer can never start. You may find a related answer helpful: activity diagram - call operation example with parameters?
2) Your class diagram does not have association-end names. You have two properties of type Board in Tictactoe and two properties of type Tictactoe in Board.
first activity diagram
The last diagram. You have to do the return AFTER check, not before it. Or you'll have infinite loop.
Class diagram
Yeah it looks pretty good. Though I am suspicious with the composition Player to TickTackToe. I mean the class itself can exists even without the player.
And the user in the activity diagram should terminate the game too. Don't forget that function.
Activity diagram:
Your activity diagram allows to execute action "move First" or "Move Second" only once and you must start whole activity again to continue. Player is not a participant. Game is only participant. When you start game, it must wait for event "start". After event occured, you can wait for "Move First" or "Move Second" event. You have to switch player after some of move events occured. I think, you activity diagram does not need to have final nodes. When you turn off game, activity i stopped. Activity defines behavior. Behaviorn can by set as classifier behavior and activated within creation of classifier instance.
Class diagram:
Player is not in composition with game
UseCase:
I would say that UseCases you defined are steps of activity diagram. Meaninfull usecases would be "Play Game" or maybe "Show Score".