October 30, 2014
Hot Topics:
RSS RSS feed Download our iPhone app

AJAX: Asynchronous Java + XML?

  • August 11, 2005
  • By Coach K. Wei
  • Send Email »
  • More Articles »

AJAX Architecture

From a software architecture point of view, following are ways in which AJAX differs from today's Web application architecture by adding a client-side engine:

  1. Use of a client-side engine as an intermediate between the User Interface (UI) and the server;
  2. User activity leads to program calls to the client-side engine instead of a page request to the server;
  3. XML data transfer between server and the client-side engine.

The client engine is the key to the AJAX model. Without this engine, every user event must go back to the server for processing. User interaction is tightly coupled with server communications—the client engine unlocks this dependency. This engine, while running inside a Web browser, gives the browser the "extra" intelligence to perform a "partial screen update" instead of a "full page refresh." This engine also communicates with the server in the background, decoupling user interaction from server communications.

Figure 3: Classic Web Application Architecture

Figure 4: Ajax Architecture

Different Technology Options for AJAX

Considering that AJAX represents a Web application model that is defined by partial screen update and asynchronous communication, there are different technologies for building the AJAX client engine, of which JavaScript, Java, and Flash are the most commonly used. Likewise, these three technologies are the most widely used in building AJAX applications.

The Java approach ("Asynchronous Java + XML")

The Java approach typically uses a browser-based lightweight Java engine for client side processing, such as UI rendering, performing partial screen refresh and asynchronous server communication. In this approach, the UI can be defined using XML, whereas client-side application logic is programmed using standard Java.

Examples available over the Internet include:

The JavaScript/DHTML approach ("Asynchronous JavaScript + XML")

The JavaScript/DHTML approach typically uses a browser-based lightweight JavaScript library for client side processing, such as performing partial screen refresh and asynchronous background network communication. In this approach, the UI is typically defined by using DHTML and client-side application logic is programmed using JavaScript.

Some examples include Google Map (http://map.google.com) and Google Suggest (http://www.google.com/webhp?complete=1&hl=en).

The Flash approach ("Asynchrounous ActionScript + SWF")

The Flash approach typically uses a browser-based Flash engine with an ActionScript library for client side processing. In this approach, the UI is typically defined using SWF (a Macromedia proprietary binary format for defining Flash based movies) on the client side, and the client-side application logic is programmed using ActionScript.

Some examples include BroadMoor Hotel (http://www.broadmoor.com/), a Flash-based interactive hotel reservation system.

Strength and Weakness of Different Options

Each of the three AJAX options has its own strengths and weaknesses, making each one suitable for different applications. The following table summarizes their strengthes and weaknesses:

Option Strength Weakness
Java
  • Robust performance and reliability
  • Ease of maintenance due to object-oriented programming
  • Good for Java developers
Requires Java programming skills
DHTML/JavaScript
  • Fits well with existing HTML Web sites/Web applications
  • Good for DHTML Web developers
  • JavaScript/DHTML code is hard to maintain and not designed for team development
  • Performance and functionality limitations
Flash
  • "Sexy" animations
  • Good for graphics designers
  • ActionScript code is hard to maintain and not designed for team development
  • Performance and functionality limitations

The Java approach is capable of delivering good performance and functionality due to binary execution, multi-threaded computing, and the industrial strength of Java Virtual Machine. Applications written in Java are easy to develop and maintain because of the object-oriented programming nature of Java. It is good for enterprise Java developers who have Java programming skills. On the other hand, the Java programming skills requirement is also its weakness, because developer skill set requirements are higher than scripting. Historically, JVM compatibility in various browsers has been a significant issue for this approach. However, there are solutions available for these problems. One solution is to utilize a lightweight, JDK 1.1-compatible Java engine that is guaranteed to run inside all browser-based JVMs. This Java engine would abstract developers away from the traditional problems, enabling the development and universal deployment of Web applications by leveraging the strength of Java.





Page 2 of 3



Comment and Contribute

 


(Maximum characters: 1200). You have characters left.

 

 


Sitemap | Contact Us

Rocket Fuel