The whole principle behind the MVC design pattern is fairly straightforward. Indeed, as shown in the following figure, it is composed of three blocks: Model, View, and Controller. More specifically, the intent of the MVC is to define a one-to-many dependency between objects so that when one object changes state, all its dependents are notified and updated automatically:
Let us analyze the preceding image block by block:
- The Model stores the data required by the application according to commands sent by the Controller.
- The Controller receives actions from the User (that is, a click on a button) and directs Model