ASP.NET MVC framework | Overview


MVC Overview

First, it is defined in the System.Web.MVCnamespace

1 Introduction

MVCIt is a软件架构模式

特点They are: separation of concerns, easy expansion and maintenance, separate front and back end developers not affect the work content and work progress

ASP.NET MVC框架Uses two built-in view engine, namely: ASPXand Razor, you can also use other third-party or custom view engine, strongly typed data exchange through the development becomes more clear, efficient, powerful routing function and friendly URL重写.

Because it is open source, through Nugetcan be downloaded to a lot of open-source plug-in library tool

2, the model, view and controller

He said upper portion, MVCa 软件架构模式mode is divided into three parts:

  • 模型(Model): Means implement application logic data fields. Typically, the model state model object retrieves and executes the store or read data.
  • 视图(View): Displaying a user interface UIcomponent, the content is generally created by the view of the data model.
  • 控制器(Controller): Processing user interaction using the model and selected to be presented to the user view of the flow control means and the like. The controller receives the user's request, and the processing information of the user to be queried, the controller finally returned to the user a view.

The following figure shows the relationship between the three:

Here Insert Picture Description

3、Routing

In a conventional ASP.NET Web Formsframe, a URL request is a request corresponding to a ASPX page (the presence of physical objective reality ASPX pages); however MVC框架, one URL request is 控制器中的Action方法handled, because the use of URLRouting(路由机制)to properly locate Controller(控制器)and Action(方法)in Routingthe main role is解析URL和生成URL

Look at URLRoutingthe implementation of a flow chart:

Here Insert Picture Description

He published 190 original articles · won praise 373 · views 80000 +

Guess you like

Origin blog.csdn.net/lesileqin/article/details/104095270