[MVC Framework] -- what is the MVC Framework and the framework is mvc
After learning the classic layer-3 architecture, I feel that any framework is no longer difficult. In any case, I need to connect to the database, process and display the business logic. The rest is nothing more than coupling the three layers. The more decoupling and integration are in place, the more acceptable this framework will be.
Baidu Baike: The full name of MVC is Model View Controller, which is a software design Model. It organizes code by separating business logic, data, and interface display, the business logic is aggregated into a component. You do not need to re-compile the business logic while improving the custom interface and user interaction.
MVC is divided into three parts:
● Model: Model, indicating the application core, such as the data record list
● View: displays data.
● Controller: A Controller that controls various database operations.
Although MVC is divided into three parts, MVC has nothing to do with the classic layer. It only exists in the Web layer and separates the data, service processing, and display of the web layer.
View
A view is the page on which the user sees and interacts with the customer. In addition to basic HTML elements, the view in MVC also includes XML and other identification languages. MVC can process multiple views, and a view does not need to be like that in HTML. It only represents a webpage. Instead, a webpage consists of multiple views, they also have their own different things.
Model
The model is used for business logic judgment and database access. In our ordinary saying, that is, business logic processing, we can say that the BLL layer and DAL layer functions in three layers are implemented.
Controller
The Controller transmits user input commands and data to the business model. When a user applies to submit a form in the view, the controller does not process the data, but calls the appropriate model for processing. It is a controller. In fact, it is also like a route, pointing to a model route.
Create
When VS creates an MVC project, it usually creates a project in the solution, and then selects ASP. NET MVC3 Web application:
Then select an empty application and select the Razor view engine. Of course, you can try the other two. One is a complete small MVC example and the other is a half-done example.
Click OK to create
Look at the folders in MVC.
● Application information
Properties
Reference
● Application folder
App_Data: used to store Application Data
Content: used to store static files, such as CSS files and images.
Controller: used to store Controller classes
Models: used to store model classes
Scripts: used to store JavaScript files
Views: used to store various Views
● Configuration file
Global. asax
Packages. config
Web. config
Summary
Although MVC has three parts, it does not have to do with three layers. If classification is required, it belongs to the framework mode. The initial understanding of MVC is so much that we can continue to learn.
Copyright Disclaimer: This article is an original article by the blogger and cannot be reproduced without the permission of the blogger.