Making the domain-model of tic tac toe

Posted by devoured elysium on Stack Overflow See other posts from Stack Overflow or by devoured elysium
Published on 2010-06-07T22:41:56Z Indexed on 2010/06/08 0:12 UTC
Read the original article Hit count: 622

Filed under:
|
|
|

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

I've defined the game with two actors, Player O and Player X.

  1. I'm not sure about defining both a Tile and a Tile State. Maybe I should only define a Tile and have the 3 possible states specialize from it?
  2. I'm not sure what is best: to have both 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

© Stack Overflow or respective owner

Related posts about c#

Related posts about java