ASP. net mvc Case Study (Based on ASP. net mvc beta) -- Article 7: gossip ASP. NET MVC

Source: Internet
Author: User

Summary
As the end of ASP. net mvc case study, this article only gives some opinions on the ASP. net mvc Framework from a personal perspective. And the series will be attached at the end.Article.

Preface
The purpose of this article is to summarize some things to help friends better use this framework. However, I did not translate the advantages and functions listed on the official website to list them here.

Therefore, I 'd like to comment on this framework from my personal point of view. If not, please correct your criticism. Pai_^

ASP. net mvc -- the product of spiral progress
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, the web form programming model launched by Microsoft is very creative and practical, even from the current perspective. Microsoft pioneered the development of desktop applications into Web Application Development: Drag controls, write event processing, and running... everything is so beautiful, in addition, the static Code and the backend Program are isolated from each other in the preceding two files, you can also use. 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. It seems like 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!
just use it a little bit and 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
let's take a look at what ASP. net mvc denies? What else can be obtained.
1. server-side form control.
due to 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, the event-driven model is naturally not recommended. The two are mutually reinforcing. 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 simplified table data, you must get used to the data binding of the gridview. net MVC. 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!

Summary
Now, this series is over.
In the beginning of this series, I once said that the only purpose of this series is to keep ASP. net MVC friends outside quick start, Quick Start, quickly learn to use this framework for applications, so this series has been written under the guiding ideology of "practical. It is not comprehensive and does not involve all aspects of ASP. net mvc. However, I believe that now you have the ability to learn those "aspects" on your own. Of course, it is not in-depth enough to explain the underlying principles. However, you can also study the principle of the base class based on practical experience.
In short, as long as you can use this series of articles, learn to use the basic methods of ASP. net mvc, and have begun to try demo. Then, my goal is achieved.
Finally, the demo of this series of articles is attached: mvcdemo.rar.

Summary
As the end of ASP. net mvc case study, this article only gives some opinions on the ASP. net mvc Framework from a personal perspective. And the demo download of this series of articles will be attached at the end.

Preface
The purpose of this article is to summarize some things to help friends better use this framework. However, I did not translate the advantages and functions listed on the official website to list them here.

Therefore, I 'd like to comment on this framework from my personal point of view. If not, please correct your criticism. Pai_^

ASP. net mvc -- the product of spiral progress
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, the web form programming model launched by Microsoft is very creative and practical, even from the current perspective. 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. It seems like 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!
just use it a little bit and 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
let's take a look at what ASP. net mvc denies? What else can be obtained.
1. server-side form control.
due to 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, the event-driven model is naturally not recommended. The two are mutually reinforcing. 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 simplified table data, you must get used to the data binding of the gridview. net MVC. 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!

Summary
Now, this series is over.
In the beginning of this series, I once said that the only purpose of this series is to keep ASP. net MVC friends outside quick start, Quick Start, quickly learn to use this framework for applications, so this series has been written under the guiding ideology of "practical. It is not comprehensive and does not involve all aspects of ASP. net mvc. However, I believe that now you have the ability to learn those "aspects" on your own. Of course, it is not in-depth enough to explain the underlying principles. However, you can also study the principle of the base class based on practical experience.
In short, as long as you can use this series of articles, learn to use the basic methods of ASP. net mvc, and have begun to try demo. Then, my goal is achieved.
Finally, the demo of this series of articles is attached: mvcdemo.rar.

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.