Reuse, elegance, and flexibility-Web Forms, Rails, CS. Chameleon

Source: Internet
Author: User

In recent times, many people have admired RoR as the best Web development framework. They say that it is the complexity and excessive encapsulation of Web Forms. I am also cautious with RoR (because it has not been used in real projects after all) and think it can improve development efficiency in many cases, however, if Web Forms is nothing compared with it, I cannot agree.

I think there are the following reasons:
1. The function of encapsulating Html, Javascript, and Css with controls provided by Web Forms is a dream of many Web developers in the Asp/Php era. A widget can be conveniently used on any page of any project. There seems to be nothing in RoR. to reuse View code between different projects, I'm afraid only the source code-level Copy & Paste & Edit | Debug Method is required? Imagine a pagination, sorting, selection, and online Add/edit/delete records in the GridView control; or A TreeView control that can expand, collapse, and delete nodes online, the implementation in RoR is only a headache. In Web Forms, there are current controls. Even if they are not, we only need to do a job to write them, you can directly reference it later.

2. Web Forms not only encapsulates the various code from the Render to the client, but also standardizes the Code Execution Process on the server, so that MagicAjax may occur. in this way, you only need to add a <AjaxPanel> to easily implement the Ajax function library (Yes, I know it is very easy to add Ajax features in RoR, however, the appearance of RoR is far different from that of Web Forms. The latter was not specifically considered for Ajax at the time of its birth ). Theoretically, if one day, ML (such as XAML) replaces HTML, Web Forms can be easily migrated to the new platform-because the control encapsulates the Render logic, with this change, most pages can be easily transplanted. In contrast, RoR may be inferior to Web Forms in coping with the scalability/change capability of underlying technology platforms-at least not confirmed by facts.

3. Although theoretically speaking, Http/Html/Javascript/Css... people who do not know much about the technology should not do Web development, but in fact, just like programmers who have almost no idea about the customer's industry but are developing specialized software in the industry, there are still many such people. Web Forms makes it easier for these people to complete their tasks without having to make a year of basic knowledge (and I am a little skeptical about it, can I easily use RoR with the knowledge above? Even though the RoR code looks very beautiful and very similar to the natural language, it will be difficult to write it, because I must always think about which natural language my computer can understand ). VB is popular because it allows you to become a programmer as quickly as possible-to complete the tasks you must complete. Yes. When it comes to advanced topics such as dynamically creating controls, Web Forms performs very poorly and is not elegant, but at least these tasks cannot be completed, even in this case, you can use Asp.net in ASP mode -- after all, Asp.net contains a much greater connotation than Web Forms.

4. Because Web Forms is part of Asp.net, Asp is automatically obtained when we use it. net brings numerous benefits, such as unified, rich and very easy to expand class libraries, convenient deployment, powerful and easy to use IDE and so on. Also, the most important thing is that Asp.net allows you to customize HttpHandler, which means that when you think Web Forms is inappropriate, you can write/use third-party Handler, such as MonoRail, these different Handler can coexist in the same project and communicate with each other conveniently. In RoR, I don't know if there is such a mechanism. I guess there is no such mechanism yet.

5. Web Forms are very mature. Compared with RoR, there are still many areas to be improved, such as global, default implementation of common functions (such as Membership), and development environment, wait, and so on. After all, some people in Microsoft have money and spent year 56 to improve a technology, which is not something that others can keep up with in a short time.

All in all, the advantage (or more appropriate features) of Web Forms lies in encapsulation and reuse. The advantage of RoR is that it takes good care of the current Web development needs and the code looks more elegant.

In addition, I wonder if you have noticed the Performance Engine Chamelone in CS2007? It is a bit like a webpage template, but can actively obtain data based on the context. For example, a UserData control contained in the SectionList will automatically obtain the first owner of each Section. If it is put in ForumPost, it will get the Author of this Post. Based on some of its other features, we can almost only develop some Control, then, no program code is required on any page to display any data. This means that the artist and programming are truly different from each other!

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.