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:
- Full control over HTML rendered. No renaming of HTML IDs
- Provides clean separation of concerns (SoC).
- No View State (Stateless).
- Enables Test Driven Development (TDD).
- Restful URLs that enables SEO. Representational state transfer URLs example User/Comment/1, which is user friendly, no URL rewriting required.
- Supports multiple view engines (aspx, Razor)