What is MVC?
MVC is just a three layer architecture where M stands for MODEL, V stands for VIEW, and C stands for CONTROLLER. Each of these components are built to handle specific development aspects of an application. MVC is one of the most frequently used industry-standard web development framework to create scalable and extensible projects.
MVC stands for Model, View and Controller. MVC separates application into three components – Model, View and Controller.
A) 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. A model can be used to pass data from Controller to view.
Model is a data and business logic.
B) View: View is a user interface. View display data using model to the user and also enables them to modify the data. The View is used for all the UI logic of the application. It’s an ASPX page without having a code behind file.
View is a User Interface.
C) 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. Controller can access and use model class to pass data to views. Controller uses View Data to pass any data to view.
Controller is a request handler.
The MVC pattern helps you create applications that separate the different aspects of the application (input logic, business logic, and UI logic), while providing a loose coupling between these elements. The pattern specifies where each kind of logic should be located in the application. The UI logic belongs in the view. Input logic belongs in the controller. Business logic belongs in the model. This separation helps you manage complexity when you build an application, because it enables you to focus on one aspect of the implementation at a time.
The loose coupling between the three main components of an MVC application also promotes parallel development. For example, one developer can work on the view, a second developer can work on the controller logic, and a third developer can focus on the business logic in the model.
1. MVC is separation of concern. Separation of concern means we divide the application Model, Control and View.
2. We can easily maintain our application because of separation of concern.
3. In the same time we can split many developers work at a time. It will not affects one developer work to another developer work.
4. It supports TTD (test-driven development). We can create an application with unit test. We can write won test case.
5. Latest version of MVC Support default responsive web site and mobile templates.
6. We can create own view engine. It is syntax is very easy compare to traditional view engine.