Design Patterns and MVC
Introduction to Software Engineering (CSSE 1001)
The Model-View-Controller (MVC) is a design pattern that separates a game into three components:
- Model: Responsible for storing the state of the game and handling state transitions.
- View: Some (usually visual) representation of the state of the game.
- Controller: An interface for a user to trigger state transitions.
- Modularity
- Ideally we want these pieces to be modular so that we can swap new model, views, and controllers : without breaking our application.
Exercise 1 Draft the interface for three classes: Model
, View
, and Controller
that implement a game.
Take particular care that arbitrary changes to the implementation to Model
do not affect View
.