ASP. net mvc -- the product of spiral progress

Source: Internet
Author: User

Why does Microsoft release asp. net MVC, which we cannot know. Maybe it is because of struts on the javaee platform, maybe because MVC is too popular. Maybe Microsoft wants to improve its web app platform, in short, we can only guess. However, it would be interesting to review the evolution of Microsoft's web app platform.

ASP -- Microsoft's earliest contribution to web development may be ASP. This dynamic language makes dynamic web page development more difficult than ever. However, when many people are excited to use ASP to write one dynamic web page after another, its disadvantages gradually become exposed: the language is too simple, without object-oriented support, good ide support, dynamic scripts, and static html, Making modification and maintenance extremely difficult.

Web form-to be honest, even from the current perspective, the web form programming model launched by Microsoft is indeed very creative and practical. Microsoft pioneered the development of desktop applications into Web Application Development: Drag controls, write event processing, and running... everything is so beautiful, and the static code in the previous section is completely isolated from the back-end program in two files, and you can use it. any language on the Net Platform for backend programming. For programmers, using C # for programming is much more comfortable than using ASP. Therefore, the web form model can be said to be synonymous with. NET web app development. All Web developers Based on. NET platforms are familiar with and accept this model.

ASP. net mvc-Microsoft launched ASP. net mvc when web form became popular. Strictly speaking, Asp. net MVC and web form are not comparable. Web form is a complete new model, from the top layer to the bottom layer is a complete set of things, while ASP. net MVC is just a MVC coat for web form. It should be a programming method model Extension Based on Web form. However, from the perspective of developers, Asp. the launch of net MVC has indeed greatly changed our development methods. Many web forms are not recommended (you can still use them because ASP. net MVC is also based on Web form. For example, the server-side controls that have been praised have been abandoned again and the client controls have been used again. The event-driven model has been abandoned, instead, we use a URL jump processing model similar to the traditional one. In addition, data verification and other methods have greatly changed with the methods advocated by web form.

In this case, it seems like a reincarnation, and ASP. net MVC brings us back to the ASP era: server-side models are not used, event-driven mechanisms are not used, and desktop apps are not used for development... we seem to have returned to the traditional ASP era from web form. But is that true? Of course not!

You just need to use it a little bit, you will know that although ASP. net MVC advocates us to abolish many things and habits under Web form, but it is not to let us "return to the original". If we have to say it is a cycle, it should also be said that it is a spiral cycle, is a rising cycle.

Remember that there is a classic proposition in Marxist Philosophy: for new things, the road is tortuous and the future is bright. Perhaps the development of the web app model proves this point. Maybe, server-side controls and event-driven models are not suitable for Web apps at the beginning. Microsoft has taken many detours and has now found the right direction. We need to abandon what we thought we were used to and put into a lot of painstaking efforts. However, after a thing is denied, the rest is a new thing, is a better thing.

For example, we have abandoned the server-side controls and event-driven models that have been used for many years ...... However, we have gained a low-coupling new web model that focuses on the isolated MVC model. You must dare to deny it before you can get a new student. Microsoft is. So are we.

Changes brought about by ASP. NET MVC

Next, let's take a look at what ASP. net mvc denies? What else can be obtained.

1. Form Controls on the server side.

Because ASP. net MVC, server-side form controls are no longer recommended for use, such as our text box, no longer use ASP: Textbox, but use traditional input, or directly let HTML. textbox generation. In short, many server-side controls have been abolished. Even the old friends like gridview that once brought us infinite pleasure are no longer recommended for use. However, it does not mean that we cannot use any server-side controls. For example, to implement the master, our contentplaceholder must still be used.

2. event-driven model.

Since Form Controls on the server are no longer recommended for use, the event-driven model is naturally not recommended. The two are inherently complementary. In ASP. net MVC, when a button is clicked, you should not habitually think of the corresponding Aspx. there is a time processing method in CS. You should think of an action in a controller to handle this event. In fact, in ASP. net mvc, we recommend that you do not write any logic code in Aspx. CS. Even when they do not exist.

3. Data Binding

For structured table data, you must be used to the data binding of the gridview. However, since you use ASP. net mvc, This is not promoted. You should process data display by yourself. Of course, we can also look forward to a powerful helper in the official ASP. net mvc version to help us with data display.

Benefits of ASP. NET MVC

You must know what we can get if we have paid such a terrible price for using ASP. NET? In my opinion, you get at least the following:

1. Clear and focus on Separated code;

2. Easier testing and maintenance;

3. More MVC-compliant presentation layer;

4. You can proudly say to Java programmers: I am using the MVC mode now, and I don't need to write any XML!

 

MVC layer-3 Architecture
Http://www.cnblogs.com/Terrylee/archive/2008/01/01/aspnet-mvc-framework-vs-wcsf-mvp.html

 

Related Article

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.