Why and how to build an AJAX application?

(By Mark Qian on 9/6/2006)


PREFACE

  
 I felt a little bit sorry for Remote Scripting about using "AJAX" in the title because what I really
 meant was Remote Scripting. In all my articles below, as you can see, I mostly use my Communicator
 to handle the communication to server. My Communicator always provides 5 ways to communicate while AJAX
 is only one of them, a small piece within the Remote Scripting territory.
 
 "AJAX" or "Remote Scripting" only allows you to "asynchronizely" communicate with servers and carry out 
 the communication with AJAX is very simple: 
 
    - create an AJAX object
    - make a call to the server given a callback handler
    - process the response in your handler. 
    
  But there is a long way between "AJAX" and "AJAX Applications": after obtaining this "easy-to-use" gun, 
  you may be wondering two things:
 
   a). When might this thing shoot back on me?
   
   b). Where should I shoot?
 
 The goal of this collection of live-code articles is to discuss and answer these two questions.
 
 First, let's take care the safty issue: when may AJAX cause problem?
 
      Here are some: Show details
        
 
 Secondly, where should you use AJAX? Let's look into it from top down:
    
  • What is really AJAX?
  • It isn't called AJAX but Remote Scripting. -- a "gun" that can either shoot at you or your enemy... Snapshots of the article: Show details
  • Why do we use AJAX?
  • I think that there two major reasons to use AJAX: A. improve usability Show details B. improve scalability by eliminating unnecessary page reload Show details
  • Define the AJAX zones
  • The fundamental strategy of AJAX is eliminating entire page reload when user do interaction on the page. That is, the page should be designed to communicate with users by replacing "zones" on the page until it is necessary to load another page for next business-communication phase. One of typical example is the page with depend sections where what to display on next zone is determent by value of a field in current zone. See details at Dependent sections So one of the most initial and important design phase is defining "asynchronizely updating zones". Here are some typical "AJAX Zone" candidates: A.How to submit a form "silently" Snapshots of the article: Show details B.Dependent sections Snapshots of the article: Show details C.The On-demand Scrollable Table Snapshots of the article: Show details D.The On-demand Tree Snapshots of the article: Show details E.AutoSuggest Text Box Snapshots of the article: Show details F.Client Side Include Snapshots of the article: Show details G.Client-Side HTTP Session timeout Notification Snapshots of the article: Show details (More to come soon...)
  • Design pattern and strategy
  • Remote Scripting makes a big space available for web application to be improved and expanded. There are a variety of approaches, pattern and strategies. I will discuss some of the design strategies that I used, specially focusing on scalability. A. How to access objects in server from javascript namespace a. Under Spring MVC Snapshots of the article: Show details B. Cache Usage a. Cached HTML Snapshots of the article: Show details b. Client Side Include Snapshots of the article: Show details