Skip to content

MVC Architecture

Yash edited this page Jun 14, 2018 · 2 revisions
Model View Controller (MVC) software architecture pattern for developing web applications.

Design patterns are important to write maintainable and reusable code. A pattern is a reusable solution that can be applied to commonly occurring problems in software design

MVC pattern overview Chrome

MVC offers architectural benefits over standard JavaScript — it helps you write better organized, and therefore more maintainable code. This pattern has been used and extensively tested over multiple languages and generations of programmers.

MVC is commonly used for developing software that divides an application into three interconnected parts. MVC is composed of three components:

  • Model − The lowest level of the pattern which is responsible for maintaining data.
    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 − This is responsible for displaying all or a portion of the data to the user.
    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 − Software Code that controls the interactions between the Model and View.
    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.

Clone this wiki locally