The whole principle behind the model-view-controller design pattern is relatively simple. Indeed, as shown in the following diagram, it's composed of three blocks: Model, View, and Controller:
The components are as follows:
- The Model stores the data required by the application according to commands sent by the Controller.
- The Controller receives actions from the user (such as the click of a button) and directs model updates accordingly. It can also switch which view is used at any given moment.
- The View is generated and updated every time the model changes.
And that's it.
Let's ...