I am trying to make the domain model of a Tic Tac Toe game. I'll try then to go on through the various steps of the Unified Process and later implement it in some language (C# or Java).
I'd like to have some feedback if I'm going on the right path: alt text http://dl.dropbox.com/u/6187267/shooterpics/tictactoedm.jpg
I've defined the game with two actors, Player O
and Player X
.
Tile
and a Tile State
. Maybe I should only define a Tile
and have the 3 possible states specialize from it?Player O
and Player X
be associations with Tic Tac Toe
or have them inherit from Player
that is associated with Tic Tac Toe
. Following the design shown on the pic, in theory we could have a Tic Tac Toe
concept with 2 Player O's, which wouldn't be correct. What is your opinion on this?Also, am I missing something in the diagram? Although I can't see any other actors for Tic Tac Toe, should I have any other?
Thanks
An alternative class decomposition would be to replace Board and Tile with Game and Move. A game would contain a legal series of Moves, and a Move would contain the square coordinates (or some other identifier) and whether it was player O or X. This scheme holds a little more information allowing the game can be replayed and backed up.
To your diagram:
When you are talking domain model (in context of UP), you should forget about creating a software system and include only what is important for the domain of the tic tac toe game. Think of how any game is described - it has its rules (preparation, turns, game end conditions, ...), players (with identity for more games, points, owned/controlled components, roles ...) and physical components (boards, tokens, figures, cards...). If you accept those elements to be part of the domain model for games and therefore metamodel for your tic tac toe game, you should use elements, which are instances of that elements.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With