mardi 24 mars 2015

MVC : Is there any situation where the model can interact with the user?

I am currently learning how to use the MVC pattern by developing an Connect Four game with a graphic and console view ( JAVA ). The app in console mode has two ways of asking for a move:



  • Manually introducing the column where you want to put the chip

  • Randomly generating a valid column.


So we have two modes (Manual & Random) to choose for Black and White players I have implemented a Controller class which manage all the possible commands and handles the exceptions and a class called "ConsoleHumanPLayer" which asks the user in what column he wants to put the chip in.


This class "ConsoleHUmanPlayer" uses the scanner and is currently inside my "Model" package along with the Board and Valid/Invalid Moves, so my question is: is this a good way to use the MVC pattern or should i keep all user interaction limited to the view / controller sections?


Aucun commentaire:

Enregistrer un commentaire