Tuesday, February 2, 2010

Why is AJAX a comfortable fit with JAVA?

AJAX is a comfortable fit because, using Java Enterprise Edition the following tasks can be performed:
  • AJAX client pages can be generated to server incoming AJAX requests
  • Server side state is managed for AJAX clients
  • AJAX clients can be connected to enterprise resources.

What is synchronous request in AJAX?  

Synchronous AJAX is a process that makes a java script to halt or stop the processing an application until a result is sent by a server. The browser is frozen, while the request is processed. The response time is 99.99% quick and fast enough. In case of intrusion for a request or transfer of the file, the browser freezes may be for two minutes until the time is out for the request. The advantages of using synchronous AJAX are, simple to code and can be used in the events ‘onunload’ and ‘onbeforeunload’

When should I use a Java applet instead of AJAX?  

  • Applets provide features like custom data streaming, graphic manipulation, threading, and advanced GUIs which AJAX cannot.
  • However, with the help of DHTML, the functionalities of AJAX can be extended further.
  • AJAX requires that the browser be DHTML and AJAX capable.
  • AJAX-based functionality does need to take browser differences into consideration due to which using a JavaScript library such as Dojo which abstracts browser differences is recommended.
  • AJAX/DHTML works well for applications where the latest browsers are used.

How Ajax is different?  

An AJAX application introduces a layer between the user and the server which comprises of the AJAX engine. This eliminates the adhoc interaction between the client and the server and makes the application more responsive.
A browser loads an AJAX engine instead of the web page and then communicates with the server on users behalf as well as provides the user with an interface.
As the communication with the server in AJAX is asynchronous, the user doesn’t have to wait for a server response.

Is the server or the client in control in AJAX?  

With AJAX the control can be more centralized in a server-side component or a mix of client-side and server-side controllers.
  • Centralized server-side controller
    In this type of architecture, the controller ensures that the data on the client and the server are synchronized.
  • Client and server-side controllers
    In this type of architecture the presentation related control, event processing, page manipulation, and rendering of model data is done through Javascript on the client side.
    The server-side is responsible for business logic and pushing updated model data to the client.
    Both methods are viable depending on the kind of task. However, the centralized server side controller is preferred as in the other case (Client and server-side controllers) the server might not have the knowledge of the state of the client page.

Are there Usability Issues with AJAX?  

The nature of updating a page dynamically using data retrieved via AJAX interactions and DHTML may result in drastically changing the appearance and state of a page.
Since the pages get updated dynamically, the state of a page may not remain the same.
So the behavior of a page may need to be defined in each of the following user actions:
  • Navigation using the back or forward buttons of the browser
  • Book-marking a page
  • Sharing a URL
  • Printing a page at any given time
Navigation:
The output of the user actions like a page refresh, forward or back navigation, etc need to be defined.
In this case using a JavaScript framework such as Dojo that provides API's history manipulation and navigation control would be simpler.
Book-marking and URL sharing:
Dojo provides client-side interface for book-marking and URL manipulation.
Printing:
Issues could arise while printing dynamically rendered pages.

0 Comments: