Design

This document explains the framework design philosophy.

Introduction

The framework design follows the Model-View-Controller (MVC) principle.

Definition

The Model owns the game state.

The Controller stands for the interface the User can manipulate to send orders to modify the game state.

Finally the View reflects how the User perceives the game state.



fig 1. Model-View-Controller

The game state may require to be replicated, hence proxies dealing with the distribution in-between each Controller-Model and Model-View pair are introduced.



fig 2. Proxy Model-View-Controller

Applicability

Every turn-based game functionalities fall into one of this module.

Security

Security checks are either dynamic or static whether they depend on the game state or not.



Static checks are to be performed by the Controller to avoid forwarding invalid orders to the Model.

Dynamic checks take place within the Model.

Synchronization

The synchronization mechanisms belong to the Controller.

Computation

The turn processing is definitly to be handled by the Model because it remains tight to the game state.

Visiblity

The visibility filtering takes place within the View.

Distribution

Depending on the architecture (MVC or Proxy MVC) the three following distributions are possible :

  • MVC with Controller and View splitted
  • Proxy MVC with Controller and View splitted (player game state views stay on moderator side)
  • Proxy MVC with Controller Proxy and View Proxy splitted (player game state views maintained by the player side)

In all cases the Controller and View cope with the distribution.

References

TitleDescription
Model View ControllerMVC description
Trinket : Model View Controller patternMVC tutorial applied to java applications
Model Pipe View ControllerMVC extension with pipes and filters description
Model View PresenterMVP description