MVC offers architectural benefits over standard JavaScript.

The MVC pattern brings modularity to your applications and it enables:

  1. Reusable and extendable codebase.
  2. Separation of view from business logic.
  3. Simultaneous work on different components  ( UI layer and core logic).
  4. Maintenance becomes easier.

MVC is composed of three components:

MODEL

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.

VIEW

View is what’s presented to the users and how users interact with the app. The view is made with HTML, CSS, JavaScript and often templates.

CONTROLLER

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.

 

Enjoy coding …