MVC (Model-View-Controller)

In this article, we will learn and understand about MVC Model-View-Controller.

Model View Controller: MVC is basically a software architecture, which separates logic from the user interface. Simply separating the application into three parts Model, View and Controller. MVC is separation of concern. MVC is also a web design pattern.

Model: It represents the logical behaviour of data given in the application. It also represents applications business logic. Model notifies view and controller whenever there is change in state.

View: It Provides user interface of the application. A view transforms the model state into readable HTML.

Controller: Accepts inputs from the user and instructs the view and model to perform a specific action accordingly.



Advantages of MVC:

  1. Full control over HTML rendered. No renaming of HTML IDs
  2. Provides clean separation of concerns (SoC).
  3. No View State (Stateless).
  4. Enables Test Driven Development (TDD).
  5. Easy integration with JavaScript frameworks.
  6. Restful URLs that enables SEO. Representational state transfer URLs example User/Comment/1, which is user friendly, no URL rewriting required.
  7. Integration on the client side becomes easy like using JavaScript, JQuery, Ajax, JSON….
  8. Supports multiple view engines (aspx, Razor)