Two Chinese open-source Ajax framework founders reveal the mysteries of Ajax framework Selection

Source: Internet
Author: User
Tags silverlight ruby on rails
Ajax has been popular for two or three years. Today's so-called Web 2.0 websites have more or less Ajax shadows. However, new Ajax frameworks are still being developed, and new versions of existing frameworks are also being released. Why?

First, the scope of Ajax applications continues to expand, from Del. icio. us simple editing function, to 999fang.com integrated Ajax and database search, to Google Spreadsheets similar to Windows applications. In addition, Ajax has been slowly applied to enterprise applications.
In addition to user friendly, security, development and maintenance costs, integration with existing application servers, services, and development environments are also the focus of enterprise applications. These are all beyond the scope of early frameworks.

Currently, Ajax is in the chasm called by Geoffrey Moore for enterprise applications. It is expected to be put into use in the next two years. The applications on consumer websites are going through a long period of time, and the focus of the spotlight will gradually move to applications such as Google spreadsheets.

In this context, Ajax frameworks spring up and emerge one after another. Many developers may have their own preferences, but some developers may not be able to start with these frameworks. We can look at these frameworks from multiple perspectives.

From the functional perspective, it can be divided into the following categories:

1. Underlying link libraries on the browser, such as prototype, script. aculo. Us, and jquery.

2. browser UI Component Libraries, such as ext-js and dojo.

3. Integrated Framework, such as ZK, backbase, and icefaces.

Among them, the underlying link library is widely used, lightweight and easy to integrate, but has limited functions. The Integrated Framework includes the complete browser-side and server-side frameworks.

DWR and GWT are difficult to classify. DWR is basically a javascript-to-Java RPC framework, while GWT is a browser development tool added to RPC.

From the perspective of application, we can roughly classify website applications and enterprise applications. The underlying link library is mostly used for website applications or as the basis of other frameworks. Both the UI component library are available, while the Integrated Framework focuses on enterprise applications.

The system architecture can be divided into client-centric and server-centric. The so-called client-centric refers to the main execution of the program code (ui part) you write on the client (browser), while server-centric is on the server side. Most frameworks are client-centric, such as Dojo, prototype, GWT, ext-JS, and backbase. Server-centric is represented by zk.

Generally, readers do not pay much attention to the differences in architecture, but it is the key to determining the development and maintenance costs.

Some people may still have doubts: Which framework is suitable for my application? In fact, there is no single framework suitable for all applications. For Web 2.0 websites that emphasize simple intuitive interfaces, there are usually only a few Ajax-based functions that can be used with the help of the underlying link library on the browser end, and considerable resources are invested, the most important thing is to make Ajax stand out. For existing web applications, such as struts, JSP, or JSF, you can choose a browser UI component library or integrated framework based on their familiarity with JavaScript. Using the browser UI Component Library requires a lot of customized JavaScript code to be integrated into the original application. The use of the Integrated Framework depends on whether it supports the existing architecture. For example, if you use the. NET platform, you can only use the Microsoft framework. If JSP is used, ZK and backbase can be used. If JSF is used, ZK, backbase, and icefaces can be used.

Web applications designed using the zk framework have rich features of fat clients and simple design models. ZK includes an event-driven engine based on AJAX for automatic interactive operations and a set of components compatible with XUL (XML user-interface language-XML-based user interface language. With an intuitive event-driven model, you can use components with XUL features to express your applications and operate these components through user-triggered listener events. ZK 3.0 has been released. Provides ready-to-use XUL and XHTML-based components: grid, Tab decorator, tree directory, combo box, chart, scroll bar, split bar, and audio. In addition, macro components are provided to make development of new components as simple and convenient as building blocks. The script writing function can use el expressions and your preferred scripting language, including but not limited to Java, JavaScript, Ruby, groovy, and mvel languages. It is worth mentioning that the latest version also integrates Google Maps, FCKeditor, dojo, and timeline, and provides development support for Google's latest mobile operating platform android.

Some people predict that the emergence of RIA frameworks such as Silverlight and flex will pose a serious threat to the Ajax framework. I think the opposite is true. Silverlight, flex, and so on are the old methods by which large software companies attempt to monopolize emerging markets with private protocol. However, the size of the Internet is not what anyone can control. Thanks to Tim Berners-Lee and others for their selfless contributions, the Internet has become the most equitable and open platform. In fact, flex was just converted to open source not long ago. This was a big setback for software priced at over $10 thousand.

Chen Jinzhou's Point of View

There is no doubt that AJAX is increasingly accepted. This is not only reflected in the application of technology, but also in the improvement of industry demands. Web applications are not only used in enterprise business systems, but also in Web2.0 applications. These applications mean that the system can only be used by dozens of people and hundreds of millions of users suddenly exist. Users have more options to attract users to stay. In addition to the gorgeous interface, it is a smooth operation interface and quick response. As a key technology to achieve Ajax without interrupting user operations, it has an irreplaceable mission to attract users.

This means that the gorgeous and Ajax web applications are also impacting the needs of enterprise applications. Although there is no statistical data, we can see that more and more enterprise applications require more intuitive interfaces, smoother operations, and less latency. For example, in the first two years, the implementation of the cascade drop-down box, most of the frameworks (or applications) is to refresh the entire page when you select one, then, update the list of values to be selected in the next drop-down Box Based on the selected one. Today, this implementation seems almost totally unacceptable to both customers and developers.

On the developer's side, there were still discussions about Ajax crimes last year. However, it seems that more discussions are immersed in a specific technology. After recognizing the essence of Ajax technology, more developers are willing to accept it or the requirements of users, and start learning and using Ajax-related technologies. From my perspective, programmers who once thought that JavaScript is not a stream-less language have gradually discovered that JavaScript is very interesting and powerful. using JavaScript to achieve cool web page effects has a sense of accomplishment, and so on.

In addition, the word Ajax has long been far beyond its original meaning. Ajax was originally Asynchronous JavaScript and XML. However, when you see a beautiful web page (Web application), almost all people have web-related knowledge. The first question is often: Is Ajax used? -- Ajax is now almost synonymous with rounded corners, drag-and-drop, brilliant, and refreshing. When a name becomes a concept and intuition, we should know how much technology is applied.

Currently, almost no one has dealt with XMLHTTP objects manually. Most developers use auxiliary libraries and frameworks such as Buffalo, DWR, and prototype for development.

Ajax framework Selection

Since few people now use only one Ajax technology, I have expanded the scope of the Ajax framework into three parts: focusing on presentation, transmission, and tool. Since my Web language is mainly between Java, Ruby, and python, the following comments do not include some tools in PHP and. net. In addition, there is a major comparison between self-developed and its main competitor, DWR. Others are only generic comments, so we can estimate them.

Focusing on Presentation: Yui, qooxdoo, and dojo

· Yui: a complete, beautiful, and comprehensive interface tool library.

· Qooxdoo: Another open source option.

· Dojo: A comprehensive library structure and rich interface controls.

Transmission-intensive: Buffalo and DWR

Buffalo features:

1. Prototype-based. If your Ajax application is also based on prototype, you can reduce the bandwidth for repeatedly loading prototype and get a fairly consistent programming concept.

2. BIND: it provides processing of the result data and binds the data directly to the page object for display. This is a moving feature. In 2.0, BIND is more powerful and can bind values directly to form elements, tables, DIV/span, and even the entire form. The key is that this binding is non-invasive and fully integrated with the overall structure of Buffalo. The external performance is only one simple {buffalo. bindreply }}or {buffalo. Bind. Bind.

3. serialization: Buffalo supports bidirectional serialization from Java to JavaScript and JavaScript to Java for any object, any depth, and any data structure, and supports reference.

4. Access to a lifecycle object: A buffaloservice must be inherited before 1.2.4. It does not need to be inherited from 1.2.4. A thread-safe buffalocontext object is introduced, which only needs to be passed through buffalocontext. getcontext () is used to obtain a thread-safe reference and operate various attributes of the request.

5. Fuzzy processing of collection/array: Buffalo provides the fuzzy recognition capability for collection/array objects. For example, a method on the server needs the list parameter, and the client can pass a JavaScript array in the past without any effort to assemble the object.

6. Client Assembly object: Buffalo supports object assembly on the client, and even directly serializes the entire form into an object as a parameter to the remote client.

7. Ability to process overloaded Methods: because the types of Java and JavaScript do not match, DWR code generation cannot process the overloaded methods. For example, sum (double, double), sum (INT, INT) DWR may not know which one you want to call. Since 2.0, Buffalo supports handling heavy loads.

DWR features:

1. Support for batch. You can put multiple service function calls in one XMLHttpRequest request.

2. converter: converts any type of Java object to JavaScript and allows direct use. For example, the customer class contains an address variable. When ajaxcall returns the customer object, you can directly use customer. Address in JavaScript to obtain the address information.

3. Some functions and attributes of expose are allowed. (Buffalo is unrestricted and can access any function in the service .)

4. dwr2.0 proposes reverse Ajax, which provides the function to process page elements in Java code.

Tool type: Prototype, jquery, and dojo

· Prototype: thanks to the design of the Ruby language, you can write Javascript in almost the same way as writing Ruby. Because it is bound to the Ruby on Rails release package, it has become the most popular Ajax Tool in the last two years. In the early days, it was small and flexible. Now, due to too many features, it is becoming increasingly bloated. At present, version 1.6 has exceeded 120 K.

· Jquery: main competitor of prototype. Simplicity is its biggest advantage. For most common complex operations and effects, jquery's code volume can be more than 50% less than prototype.

· Dojo: Manages Java packages to load JavaScript on demand. Provides comprehensive support for Ajax and Dom operations. However, additional attributes need to be embedded in HTML tags so that webpages cannot comply with W3C standards. Many developers are concerned about this.

Impact from the RIA framework?

I do not agree with this statement. On the contrary, I think that RIA frameworks such as Silverlight and flex should consider the impact of Web applications. There are almost no technical barriers in the Web field, and there are sufficient resources available for reference, such as what can be done, which are unsuitable, and load balancing. Various modes can be flexibly applied to them. Various test tools (such as selenium web testing tools) and development tools have excellent support. The RIA framework has much more problems to consider than the existing web applications.
Apart from the more elegant effects that RIA promises, it is not difficult to achieve these effects on the web with the support of multiple JS libraries. They have more questions to consider: resource Acquisition and release, test support, local storage problems, event mechanisms, State synchronization, client and server data interaction mechanisms (serialization and deserialization), and so on. Ria wants to be as large as the current web application. Most RIA-based applications require offline running of applications.
The browser is also developing. Local Storage Based on Web pages can be used in Google Reader. One day, the browser may be a perfect Ria platform, and Web applications can be used offline only after local storage support is added-similar to the RIA Technology of flex and Silverlight, and Web applications, it's hard to know which one is easier to accept.

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.