The MVC pattern brings modularity to your applications and it enables:
- Reusable and extendable codebase.
- Separation of view from business logic.
- Simultaneous work on different components ( UI layer and core logic).
- Maintenance becomes easier.
MVC is composed of three components:
Model is where the application’s data objects are stored. The model doesn’t know anything about views and controllers. When a model changes, typically it will notify its observers that a change has occurred.
The controller is the decision maker and the glue between the model and view. The controller updates the view when the model changes. It also adds event listeners to the view and updates the model when the user manipulates the view.