Real-World AJAX Book Preview: The AJAX Software Platform Requires Real Design

This content is reprinted from Real-World AJAX: Secrets of the Masters published by SYS-CON Books. To order the entire book now along with companion DVDs for the special pre-order price, click here for more information. Aimed at everyone from enterprise developers to self-taught scripters, Real-World AJAX: Secrets of the Masters is the perfect book for anyone who wants to start developing AJAX applications.

The AJAX Software Platform Requires Real Design
AJAX Development and Maintenance Challenges
AJAX has raised the awareness of the potential of Web applications. It has also deepened and broadened the use of JavaScript and DHTML in application development. There are significant benefits to AJAX, but there are also significant challenges.

The biggest challenge is its scripting approach. AJAX makes developers write a lot of JavaScript code, which is hard to develop, debug, test, and maintain. JavaScript/DHTML is not standardized and there are incompatibilities between browsers, browser versions, and operating systems. And there is a severe lack of tools for developing, debugging, and testing JavaScript/DHTML code. There is also a slim marketplace for robust components. By definition, a scripting language emphasizes "quick and dirty" at the cost of code maintainability. By contrast, a real programming language like Java and C++ emphasizes formality and strictness. For example, unlike Java or C++, JavaScript is not strongly typed. Programming errors can only be uncovered at runtime. JavaScript object properties and methods can be easily (and arbitrarily) modified regardless of a predefined interface - none of which is allowed in Java or C++.

Second, AJAX does not provide a rich user interface or incremental update capability. Developers have to code such functionality using JavaScript and DHTML. There are various JavaScript libraries available that alleviate this issue to a degree, but they still require developers to write JavaScript, which does not really solve the fundamental challenge.

Third, the AJAX development model tends to break the separation of behavior and presentation. Separation of behavior and presentation is a well-established design pattern that partitions the user interface from the application logic. User interfaces are described as markup documents and application logic is written separately in a procedure language to control the behavior. To create a rich user interface, AJAX developers tend to embed significant amounts of JavaScript inside their Web pages. Mixing JavaScript with presentation breaks the clear separation and makes the application even more difficult to develop and maintain.

In a typical application lifecycle, the most expensive part is not the initial development, but the ongoing maintenance. How to overcome these challenges and enable a "manageable and maintainable AJAX" should be a topic of high priority and importance to any significant AJAX development project.

This content is reprinted from Real-World AJAX: Secrets of the Masters published by SYS-CON Books. To order the entire book now along with companion DVDs, click here to order.

© 2008 SYS-CON Media