YOUR FEEDBACK
Immo Huneke wrote: A well written article, an ingenious solution to a real problem often encountere...
Cloud Computing Conference
March 30 - April 1, New York
Register Today and SAVE !..

SYS-CON.TV

2008 East
DIAMOND SPONSOR:
Data Direct
Frontiers in Data Access: The Coming Wave in Data Services
PLATINUM SPONSORS:
Red Hat
The Opening of Virtualization
Intel
Virtualization – Path to Predictive Enterprise
Green Hills
IT Security in a Hostile World
JBoss / freedom oss
Practical SOA Approach
GOLD SPONSORS:
Software AG
The Art & Science of SOA: How Governance Enables Adoption
PlateSpin
Effective Planning for Virtual Infrastructure Growth
Fujitsu
Automated Business Process Discovery & Virtualization Service
Ceedo
Workspace Virtualization
Click For 2007 West
Event Webcasts

2008 East
PLATINUM SPONSORS:
Appcelerator
Think Fast: Accelerate AJAX Development with Appcelerator
GOLD SPONSORS:
DreamFace Interactive
The Ultimate Framework for Creating Personalized Web 2.0 Mashups
ICEsoft
AJAX and Social Computing for the Enterprise
Kaazing
Enterprise Comet: Real–Time, Real–Time, or Real–Time Web 2.0?
Nexaweb
Now Playing: Desktop Apps in the Browser!
Sun
jMaki as an AJAX Mashup Framework
POWER PANELS:
The Business Value
of RIAs
What Lies Beyond AJAX?
KEYNOTES:
Douglas Crockford
Can We Fix the Web?
Anthony Franco
2008: The Year of the RIA
Click For 2007 Event Webcasts
TOP THREE LINKS YOU MUST CLICK ON


The Web Page as an Application
AJAX is the right technology for a Web-enabled rich user interface

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 Web Page as an Application
AJAX is the right technology for a Web-enabled rich user interface (UI). But as with any technology, unstructured software created using it is a recipe for failure. AJAX is a set of powerful and flexible technologies but its disorderly use can result in spaghetti code. If the code isn't structurally sound, the interface it presents to users is unfriendly and non-intuitive, whereas a structurally sound and cohesive system flows smoothly and delights its user. A cohesive and structurally sound UI is also conducive to iterative refinement by its users, enabling a positive feedback loop. It is cost effective, affordable by a small organization and individuals. And it provides a foundation for easily mixing in works of UI designers and artists.

Unfortunately in the past building a structurally sound UI for a complex business application was hard. Developers stumbled on a UI project only to find out that building a structurally sound UI, where a designer's work can be thrown at will, is tough. It soon became a time-consuming and labor-intensive undertaking. To make matters worse, prototyping one or two scenarios often gave a false estimate of the complexity. The real complexity came when a number of scenarios interacted with each other and the UI started to fall apart from a lack of structure. Building a rich UI was notably harder than a static or semi-dynamic Web UI. The aim of this chapter is to demonstrate how AJAX has solved some of the fundamental issues with building rich user interfaces and simplified it. We will demonstrate that it is relatively easier to build a structurally sound and cohesive UI using AJAX as opposed to other rich client technologies such as Swing and WinForms. An AJAX-based UI is well suited for iterative refinement and provides a clean interface for incorporating UI designers and artists' works.

The original title of this chapter was "The Web Page as Application, Maintain Structure and Cohesion of Complex AJAX Pages." Since the business problems people solve using computers are inherently complex, the solutions tend to be complex in spite of the project team's best attempts to keep them simple. Often software system design and implementation becomes incomprehensible. Focusing our attention back on the user interface aspects of a software system, a sound structure is the key to a comprehensible and flexible UI implementation. If we can identify a set of repeatable patterns in user interface software, then it is possible to build relatively simple software even for complex business problems. If so our chapter heading can be "The Web Page as Application: Maintaining Structure and Cohesion of AJAX Pages for Solving Complex Business Problems." The business problem may be complex but the structure of the software doesn't have to be. So here we'll try to describe a structure for AJAX UIs that solves inherently complex business problems but isn't in itself complex.

Having played with AJAX for about a year and having spent many years building UIs using Swing, WinForms, JSF and JSP technologies, there seems to be a light at the end of the tunnel. HTML DOM, CSS, scripting through JavaScript and an XML pipe to the data and services are enough for a flexible, easy-to-use and structurally sound UI framework.

To summarize:

  1. Business problems are inherently complex with ever-changing requirements.
  2. A structurally sound and cohesive design leads to an intuitive and delightful UI for solving complex business problems.
  3. A structurally sound UI is conducive to refinements and artists and UI designers can contribute.
  4. AJAX has the right ingredients for building a structurally sound and cohesive UI.
The rest of this chapter will attempt to build an appreciation of these points through discussion and illustration. The goal is not to prove them conclusively. Instead, it is to make significant enough progress so users can augment them for a particular domain by induction, interpolation, or extrapolation. The resulting output will prove these points more conclusively for the particular domain.

The initial sections of this chapter will discuss concepts abstractly. Later sections go into detail about the concepts through examples. The complete code for the examples given here can be downloaded from www.vertexlogic.com. It is available under the MIT open source license.

Assumptions and Guidelines
A brief look at the assumptions made and the guidelines used in the following discussion:

  1. A rich UI using AJAX doesn't mean popping up multiple property sheets, split panes, and docking windows. At the same time it doesn't preclude any of these constructs if required for the scenario.
  2. An AJAX UI doesn't mean precluding a page-oriented UI that is successful, easy-to-use and popular in Web applications.
  3. A rich UI using AJAX is expected to combine the two styles. How much of one over the other depends on the domain.
  4. An AJAX UI should necessarily lead to higher user productivity and satisfaction.
  5. We choose to stay within the realm of standard technologies and not introduce entirely new concepts and technologies such as a new tag language.
  6. We don't use any open or proprietary framework in our examples. The idea is not to introduce readers to a framework but to discuss concepts that provide insight into how a framework works and can be built. Other chapters will cover the available frameworks.
AJAX UI in a Nutshell
For completeness, the basic workings of an AJAX UI can be described as follows:
  1. HTML pages with JavaScript code are served to the browser.
  2. Instead of fetching a new page each time, JavaScript code fetches data from the back-end over HTTP/HTTPS or using Web Services.
  3. The data is mixed with the HTML document object model (DOM) and the final user views are created in the browser space.
  4. User interaction is handled using JavaScript code in the browser space. Based on the type of interaction, JavaScript code fetches new data and HTML templates from the back end or updates the UI state locally.
AJAX UI Architecture
Figure 5.1 shows the architecture of a system that will be used in our discussion. It is generic and something we say will apply to any variation. Even if the architecture is changed, the principles discussed should hold. In the next few sections we'll provide an overview of the components shown in the diagram. These components will be discussed at greater length with example code and illustrations in subsequent sections.

So the architecture can be viewed in two parts:

  1. Server side
  2. Client side
The server side consists of one or more instances of controller servlets, business services, and data sources. The controller servlet is the AJAX UI's interface to all the other components on the server side. The server-side components behind the controller servlet can include anything from legacy systems to Web Services. These are abstracted through APIs exposed by the controller servlet to the client. In this chapter, we'll focus on the interface exposed by the controller servlet. Any specific discussion of pure server-side component implementation is beyond the scope of this chapter.

The client-side consists of the HTML pages and JavaScript code embedded in the HTML pages or included from separate files. HTML templates and JavaScript files are physically deployed with the server, but they are really a part of the client side. HTML pages and JavaScript code morph into Model, View, and Controller components in the browser space by design intent.

XML over HTTP/HTTPS is used for interfacing between the client and server. It's possible to use Web Services for client/server interaction. But for purposes of the current discussion, we've limited the interface to XML over HTTP/HTTPS. In the example code, we've modularized the client-side implementation of this interface. It can easily be changed to work with Web Services instead of the controller servlet.

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.

About Anil Sharma
Anil Sharma is a founder of Vertex Logic and architect of its AjaxFace product. He is working with Vertex Logic's customers and helping them deploy WEB 2.0 applications built using AjaxFace. These applications are in the areas of online printing, community WEB sites and social networking. He is driving future products of Vertex Logic. Prior to Vertex Logic, he was CTO and founder of Softrock Systems and Component Plus. There he built a model driven application platform using J2EE. His primary interests include user interface infrastructures and model driven applications. He is one of the contributors of the book "Real World AJAX - Secrets of the Master".

LATEST AJAXWORLD RIA STORIES
Curl announced the release of Curl Data Kit Data Services (CDK-DS) for enterprise developers building new applications using Adobe Flex or Flash, as well as developers upgrading existing Curl applications. This addition to the Curl Rich Internet Application (RIA) Platform is an i...
rPath and WANdisco today announced that WANdisco has selected the rPath rBuilder and rPath Lifecycle Management Platform to build and maintain its Subversion MultiSite solution as a manageable set of application images for delivery in virtualized and cloud-based environments. rPa...
MuleSource has announced a partnership with FastConnect that will provide Mule architecture and implementation services throughout the French market. FastConnect spans the domains of data and service integration, through to the user interface, using technologies such as SOA, dist...
Adobe and Intel plan to collaborate on porting Adobe’s Flash widgetry to Intel’s Media Processor CE 3100, a way to put Flash-enhanced web content and rich Flash applications on television. The chip is bound for cable set-top boxes, Blu-ray Disc players, digital TVs and retail...
Here, SYS-CON's Web 2.0 Journal has asked a selection of the industry's brightest minds what their own advice would be in these troubled times, and assembled it into a ten-point guide for software vendors, entrepreneurs, and startups to riding out a recession.
SUBSCRIBE TO THE WORLD'S MOST POWERFUL NEWSLETTERS
SUBSCRIBE TO OUR RSS FEEDS & GET YOUR SYS-CON NEWS LIVE!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

Click Here

SYS-CON FEATURED WHITEPAPERS

ADS BY GOOGLE