PART 1: MVC Architecture - ASP TANMOY

Latest

Monday 4 July 2016

PART 1: MVC Architecture

MVC stands for Model, View and Controller. MVC separates application into three components - Model, View and Controller.

Model: Model represents shape of the data and business logic. It maintains the data of the application. Model objects retrieve and store model state in a database.

View: View is a user interface. View display data using model to the user and also enables them to modify the data.

Controller: Controller handles the user request. Typically, user interact with View, which in-tern raises appropriate URL request, this request will be handled by a controller. The controller renders the appropriate view with the model data as a response.


General concept:
As per the above figure, when the user enters a URL in the browser, it goes to the server and calls appropriate controller. Then, the Controller uses the appropriate View and Model and creates the response and sends it back to the user. We will see the details of the interaction in the next few sections.
Important Note:

1. MVC stands for Model, View and Controller.
2. Model is responsible for maintaining application data and business logic.
3. View is a user interface of the application, which displays the data.
4. Controller handles user's requests and renders appropriate View with Model data.

Advantage of MVC

1. Enables the full control over the rendered HTML.
2. Provides clean separation of concerns(SoC).
3. Enables Test Driven Development (TDD).
4. Easy integration with JavaScript frameworks.
5. Following the design of stateless nature of the web.
6. RESTful urls that enables SEO.
7. No ViewState and PostBack events


No comments:

Post a Comment