MVC Software Architecture

Source: Internet
Author: User

1. What is ASP. net mvc?

Before learning about what ASP. net mvc is, let's take a look at what MVC is. MVC is the abbreviation of Model-View-controller, that is, Model-View-controller. MVC is used to represent a software architecture model. It divides a software system into three basic parts: model, view, and controller ). A model is generally a data model used for encapsulation and application.ProgramBusiness logic-related data and data processing methods. "Model" has the right to access data directly, such as accessing a database. "Model" does not depend on "View" and "controller", that is, the model does not care about how it is displayed or operated. View is the UI Layer to display data. The Controller acts as an organizational unit between different layers and is used to control the process of an application. It processes events and responds.

ASP. net mvc provides a new Model-View-controller (MVC, Model-View-Controller) framework at the top layer of the existing ASP. NET 3.5 runtime. This allows developers to use the advantages of the MVC design pattern to create their own ASP. net web application, which clearly separates content display (ui or view), business logic, and background data.. net.

2. What is the relationship between ASP. NET web form and ASP. net mvc?

ASP. net mvc is just another design pattern used to Develop ASP. NET applications. It does not replace ASP. NET web form pattern, but does not conflict with each other.

3. Advantages of ASP. net mvc:

◆ No viewstate available: traditional ASP. net webform mode uses viewstate to save the state information of the form. Due to the limitations of the B/S program, viewstate must store a large string in the hidden form field, this will greatly increase the number of page bytes, resulting in slow webpage loading;

◆ Concise HTML: The final htmlCodeIt is completely controlled by itself and will not generate any "spam code ";

Faster server-side processing and client rendering: MVC simply processes "templates" without building a complex control tree, and client rendering speed will be improved;

Only one model is required for multiple views: Sometimes the data to be displayed on a page is the same, but there are slight differences in the form. In this case, you only need to modify the view section, the existing controller behavior can be used;

◆ Unit test: it is very difficult to test webform. using MVC, you can split the business logic from the page and execute controllers in ASP. NET processes to facilitate the test.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.