Model-View-Controller

MVC (Model-View-Controller)

Software design pattern

Three parts:

  • Model keeps the data (internal representations of information)
  • View is what users see (GUI) and receives input from the user
  • Controller connects the two

The model is independent of the user-interface

The controller converts user input to commands for the model or view

MVC for Tic-Tac-Toe game

Think back to the implementation of Tic-Tac-Toe.

Which methods belong in each part (Model, View, Controller)?

Exercise

Download starter code for the Tic-Tac-Toe application – this will have mainly the viewer implemented. Your job is to finish implementing the model and the controller.

Submit your solution to Gradescope for extra credit