Does Ajax have a future?

Source: Internet
Author: User
Tags object end functions object model client
Ajax

"IT168" Ajax is a combination of several sophisticated technologies designed to give users a more satisfying user experience from Web applications. This paper reviews the evolution of enterprise application architecture and tries to expound that Ajax is the inevitable product of B/s architecture development, but Ajax seems to have a bleak future because of the congenitally deficient JavaScript programming language that Ajax relies on for survival. From the perspective of middleware, the author of this paper makes his own predictions about the future of Ajax.

1. What is Ajax

The full name of Ajax is asynchronous JavaScript and XML, which is asynchronous JavaScript and XML. This is a combination of a number of mature technologies designed to give Web applications the ability to interact quickly and instantaneously with users. The technologies that Ajax combines, including:
Javascript,java scripting Language (note that this Java non-sun company Java)
dhtml,dynamic HTML, Dynamic HTML
xml,extensible Markup Language, Extensible Markup Language
css,cascading style Sheets, cascading style sheets
Dom,document object model, document objects
• Microsoft's object, called XMLHttpRequest

With Ajax technology, users will feel that a Web page is as responsive as a normal desktop application, rather than as a traditional web page, and that any operation needs to wait for the page to refresh. How does Ajax do that? There are two secrets: First, Ajax will also refresh the page, except that Ajax can only refresh part of the page, rather than the entire page; second, the Ajax page refresh is asynchronous, that is, the user can continue his other operations without waiting for the refresh to complete.

When a user browses to an AJAX-based Web application, the user's request is submitted to a proxy called the Ajax Engine (Ajax Engine), which is responsible for receiving user requests, getting responses from the Web server, and updating the browser content. Figuratively speaking, in traditional Web applications, browsers are directly dealing with the Web server, and in AJAX applications, browsers and Web servers appear between the "intermediary", and the "intermediary" is quite diligent, so that the browser can provide better service, So that users can obtain a more satisfactory application experience.

Examples of AJAX applications, Google map is a typical. Open the Google Map site (http://maps.google.com), you will see a map, zoom in on the map, zoom in and drag, and so on, the response of the Web page is very fast, it looks like the browser loaded the whole map in advance. In fact, the browser just according to your operation, to the server to request you see the data, and asynchronously update your browser content, all this, thanks to Ajax.

JavaScript and Microsoft's XMLHttpRequest object are the two legs of the Ajax engine. When interacting with the browser, the Ajax engine uses the JavaScript language, and when interacting with the Web server, the Microsoft XMLHttpRequest object is used. Because Ajax engines rely on Microsoft's XMLHttpRequest object technology, only Microsoft's IE browsers supported Ajax in the early days. Now, with the advent of AJAX-enabled Web apps, all the mainstream browsers, such as Firefox, Netscape, Opera, and Safari, also support Ajax.

2. The evolutionary process of enterprise application architecture

In the author's opinion, the advent of Ajax is not accidental. To illustrate this point, let's review the history of computer Application architecture, which may help us uncover the origins of Ajax.

The earliest computer application, is a stand-alone program, running on a computer, then there is no communication between computers and computers concept, because stand-alone applications are enough to meet the needs of people. Therefore, the two computers even in the same laboratory, but also "machine" dog smell, ways.

People's desire is never satisfied, stand-alone applications did not last long, the need for exchanging data between the two computers, with the expansion of the scope of computer applications appeared. In the PC field, the initial computer data interaction form is serial communication, and later, with Novell's famous NetWare network technology launched, running on two different machines, the program has more convenient interaction channels, so there are clients and servers, that is, the so-called client/ Server structure, referred to as C/s structure. The C/s structure is also known as the "two-terminal" architecture because it divides the application into two parts.

After several years, the C/s structure is popular it has been found that just dividing the two roles of "Client" and "server" is not enough, because as the application complexity increases, the client and server become larger, so the three-terminal architecture comes out and adds a call between the server and the client. "End" of middleware (middleware). In the three-terminal architecture, some of the functions (primarily application logic) that were spread over the "client" and "server" were slowly shifted to the middleware, which effectively reduced the burden of "client" and "Server", and the system's architecture was rebalanced.

The three-terminal architecture is now the de facto standard for enterprise applications, which is determined by the adaptability of the three-terminal architecture. Three, middleware is the most flexible, on the one hand can assume a part of the client tasks, to help build Low-cost "thin" client; On the other hand, some common services can be moved from the server to the middleware, so that the server's function more single-minded to improve performance. Middleware technology, as the core technology of the three-terminal architecture, has spawned many software companies with middleware as the main product, and the fierce competition makes the middleware technology become more and more mature.

Since then, although there is a so-called multi-terminal (Ntier) architecture, is essentially a three-port, the difference is only an application contains more than one middleware and server, but more than one middleware, multiple servers, or even a variety of clients.

3. Ajax is a B/s structure to the three-terminal system structure of the product of evolution

In the process of evolving the client/server architecture to the client/middleware/server architecture, a simpler architecture emerges with the wide application of Internet technology, which is called the "browser/server (browser/server)" architecture, referred to as B/s. Once the B/s structure appears, because it does not need to develop the client, can greatly reduce the enterprise application of client deployment and maintenance of the cost of the advantages of rapid access to software enterprises and their customers of all ages. Now, b/s structure is the most popular application architecture, whether it is a large enterprise application or small personal application, b/s structure is the preferred architecture, almost become the "default" choice of IT industry, even when we talk about a certain application, do not need to specify what the architecture is.

If the B/s structure as a variant of C/s structure (some people may not agree, hehe, just the author's personal opinion), then, we can find that B/s structure is not a three-terminal architecture. In the B/s structure, as a "client" browser and as a "server" Web servers, is directly interactive, and no middleware intervention, enterprise application business logic, either resides in the server (including Web servers, database servers, etc.), or browser as a container, there is no other place. Therefore, from the "end" point of view, b/s structure is actually "two-terminal", like C/s structure.

If this argument is set up, then, the evolution of C/s structure from "two ends" to "three ends", whether it indicates that B/s structure will evolve in the same way, thus creating a "middleware" between the browser and the client?

The advent of Ajax appears to be a response to such a prediction. Looking closely, we can find some features of the middleware in Ajax. First of all, Ajax is hosted by the functions, originally distributed on the Web server and browser, the intervention of Ajax, reduce the burden on the client and the server, many of the original need to overload the entire page of the request-response processing, now only to overload part of the page; Ajax partially takes over the communication between the browser and the Web server, while communication interception is one of the important features of the middleware. On the one hand, Ajax to the browser's request for the pre-analysis, on the other hand, Ajax response to the Web server preprocessing, Ajax in the browser and the Web server play a "mediator" role, and the three-terminal architecture in the middleware very similar.

Interestingly, the timing of the middleware and the timing of the advent of Ajax are roughly the same. c/s structure into the enterprise application for several years, the middleware appeared, and Ajax, but also in the B/s structure began to prevail in several years. The length of the specific time has not been verified, but it can be noted that the middleware is in the C/s structure of the application of a large number of emerging, client and server growing in the context of the birth, and Ajax is also in B/s structure applications springing up, the Web page on flash and advertising straggly, Users are no longer satisfied with the dull and dull application experience in the case of Web applications in the emerging.

4. Ajax has no future

If you ask, who is hot in the Web world, many people will choose Ajax. Yes, Ajax is really hot now, since Google pioneered the AJAX application of the first, in the Web, the application regardless of size, the degree of high and low, as long as the web, people or things, all to put on an AJAX fashion cloak, to show that they did not fall behind the trend. Ajax is like a table of delicious food, although the material may not be sophisticated, but the color and smell and taste, in such a temptation, programmers to maintain a calm attitude and sober mind, is not easy. In fact, wash the various flavors on the surface of Ajax, the true material of Ajax display in front of diners, we will feel that the future of Ajax is not clear.

One reason, although from the history of enterprise Application architecture development, Ajax as a B/s structure of the middleware appears, there is inevitability, but do not forget that this is a hypothetical condition, this assumption is that the B/s structure can be viewed as a two-terminal structure. This assumption is not agreed by all, because there is also a view that the B/s structure as a three-terminal structure. Very simple, as long as the Web server forward, b/s structure into a three-terminal structure: The browser is the client, the database is the server side, and the Web server is middleware. This is a very typical web enterprise application architecture, but under this architecture Ajax has no place. Part of Ajax in the browser, the other part of the Web server, and not independent, it must rely on the browser and the Web server exists, so Ajax can not be a separate end, of course, but also not to become a middleware.

The second reason, even if everyone agrees that B/s structure can be regarded as a two-terminal structure, Ajax wants to climb to the status of middleware, still facing many unresolved issues. First, the programming language on which Ajax is built is JavaScript, a scripting language, an interpretive language that is simple, flexible, and easy to get started with, but with an inherent deficiency in an explanatory language, such as execution efficiency, which is a big problem for JavaScript, playing tricks on browsers, If you want to be a middleware programming language, that's a bit reluctant; second, the Low script language structure management, but also JavaScript become a middleware programming language barrier, using JavaScript difficult to write like C + + or Java as a standard, reliable, reasonable and graceful program, and, Today's widely accepted object-oriented programming ideas, in the JavaScript to be applied, does not seem to be particularly natural.

So it seems that the future of Ajax is indeed very confusing, even by the growing number of Ajax supporters, but if you want to go farther, it seems to be powerless. The crux of the problem with Ajax is the JavaScript language. For this language, there have been two forces in the confrontation. One is bullish on JavaScript, which is easy to learn, flexible and powerful, while the other is dismissive of JavaScript and even unwilling to admit it as a programming language. I have seen some very experienced programmers, the attitude to JavaScript, can be described in the word "hate". One language has been treated so diametrically opposite, and all I know is JavaScript.

The way JavaScript has suffered so much ice and fire is doomed to the awkward position of Ajax built on JavaScript. The future of Ajax depends to a large extent on the future of JavaScript. The winner of the Princes and losers, Ajax is most concerned about, than the incompatible in front of JavaScript two forces, who will be the last winner. Ajax and JavaScript, a line of two grasshoppers, their future, has been firmly bound together, who can separate them?



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.