Ajax and Web Applications
Client Server Technology and Web Applications
There is a gap in user experience between desktop applications and web applications. Desktop applications run on a single computer, while web applications run on the Internet. Since the invention of the Web, developers have been trying to design web applications that demonstrate the speed and interactivity of applications running on the client machine of a LAN (Local Area Network). Despite the explosion of web based applications in the 1990’s (and continuing today), many users still prefer desktop applications. Like web sites, desktop applications access up to date information by connecting to the Web through the Internet.
However, desktop applications are designed with a much more refined sensibility and use PC power to customize requests from information stored on the desktop. This user experience is significantly better than when using remote web sites. Many are arguing that desktop applications will be the next wave in the Internet revolution.
So, with desktop applications breathing down their necks, web applications need to keep up the pace. Web applications are accessed by web browsers and run over a network, like the Internet. They are popular because of the power dominance of web browsers serving as thin clients. The most popular web browsers are Internet Explorer, Mozilla Firefox, Safari, Opera, and Netscape. Thin clients are client applications or devices that simply initiate requests and provide input. They do very little of the processing, letting the server handle the heavy lifting by forwarding requests and contacting different nodes and networks. Web applications are responsible for web based e mail applications like Hotmail, online shopping sites, online auction sites, wikis, and blogs.
In traditional client server computing, every application contained a client program that provided the user interface (UI) through which users would interact with/make requests from the applications. Each client program had to be installed individually on each user workstation. Web applications are different.
Web applications dynamically generate web documents. These are HTML/XHTML (Hypertext Markup Language/Extensible Hypertext Markup Language) documents transmitted over the Internet through HTTP (Hypertext Transfer Protocol). These documents or pages make up the web site. Using a standard server side scripting language like JavaScript allows for more interactive features in the user interface. Usually, each page is delivered as a static document, but the sequence in which they are presented is interactive. User web forms are embedded in the page markup, customizing responses. The web browser, acting as “universal client”, interprets and displays the dynamic web pages.
This article will be discussing the role of Ajax in user experience, which is conducted through the interface. Web application UIs offer a variety of features. For example, the drag and drop feature allows for virtual objects to be moved from location through the mouse. This can create all sorts of actions, from copying to associating two objects to create a new action. By using application specific technologies like Java, JavaScript, DHTML (Dynamic HTML), and Flash, all sorts of graphic and audio interactive features may be added to a UI. As previously stated, web developers are currently looking for ways to improve user experiences with web applications so they more closely resemble the performance of desktop applications. Remember, the user experience is most often gauged by the usability of the UI or GUI (Graphic User Interface). Ajax is one of the technologies that is helping achieve that.
What is Ajax?
Ajax itself is an acronym for Asynchronous JavaScript and XML. It contains two pre existing technologies and an information loading technique. They were brought together to create a friendly web experience. In this constellation of technology, XML is used to describe, store, and move information between clients to servers. JavaScript binds these elements together dynamically. ‘Asynchronous’ describes the information loading technique Ajax uses. It is described as such because when any changes must be made to the current page (for example, by clicking on a link or entering some information), only the part that needs to be changed is delivered from the server. The entire page doesn’t have to be re loaded, which reduces latency.
Ajax contains a whole host of other characteristics as well. It is also sturctures the way information is displayed by using HTML and CSS. By using these two technologies, Ajax ensures that the browser will understand content and formatting. Ajax also uses XML and XSLT (Extensible Stylesheet Language Transformation). XSLT allows XML documents to be converted into other XML documents. It’s part of XSL, the stylesheet language of XML. It is used to retrieve web pages from dynamic data sources and processes them for final output so they are ready to be displayed. JavaScript objects and XMLHttpRequest get information from the server and the user’s browser.
The dynamic object model (DOM) allows for the dynamic modification of the information retrieved. It alters the properties of already existing page elements to make static web pages dynamic. These instructions are accomplished by JavaScript, which is also the glue that binds all these elements and activities. JavaScript is a client side scripting language that retrieves dynamic content, modifies page elements, and displays dynamic web pages.
How does Ajax Work?
Ajax adds a layer to web application communication models. As previously stated, in traditional web applications communication between the browser/client and the web server occurred directly between these two components using HTTP requests. When users/clients request web pages, the server sends all the HTML and CSS code at once. If the user enters information into this page and requests more servers, the entire page must be loaded again. When using Ajax, the page is only loaded once. Any processing or modification caused by additional user input occurs in real time.
In addition to HTML and CSS code, Ajax also downloads JavaScript files. These three components make up the Ajax engine. So all requests for data from the server will be sent as JavaScript calls to this engine, which is located as a communication layer between the browser and the server. The Ajax engine or layer processes subsequent requests that may change the appearance or function of the web page. By requesting information from the server asynchronously, Ajax sends page bits to request services from the server as needed.
The engine allows these bits or responses to be displayed without reloading the entire page. This makes web pages and web applications much more responsive since only the necessary information is communicated between clients and servers instead of the entire page. This process imitates the responsiveness of desktop applications. Similarly, Ajax conducts all HTTP requests in the background, preventing user disruption. Users can continue working while the page sections are requested and delivered. With Ajax, the user interface is much more closely connected to application logic.
Advantages and Disadvantages of using Ajax
Because Ajax applications are more difficult to build than classic web applications, they must contain certain advantages that make them worth it. Applications built with Ajax have much more responsive interfaces. Users experience changes in a way that feels instantaneous. In traditional web applications, multiple connection threads are used to speed up deliveries between client and server. But this only affects content. All scripts and format information are communicated through a single connection thread, which negatively impacts performance. Ajax uses multiple connections to load basic scripts and CSS files; the rest is requested as content.
Again, responsiveness and timesaving are some of the most important features of Ajax. Visitors no longer have to wait for the page to be entirely re built and re sent when they make new requests. Only relevant content changes and users can still interact with the web site. There is also protection from errors. When an error is identified on a web page section, the rest of the page is unaffected and entered data is not lost. Ajax use also reduces server traffic and bandwidth use because the entire information doesn’t need to be sent with every new request.
The primary disadvantages include increased development time and costs, even though using Ajax can be more difficult to use when building applications rather than traditional client server web applications. However, this is tempered by the fact that most of the technologies that make up Ajax are already known. Ajax’s asynchronous nature can also cause conflict because it interferes with traditional ways of navigating the web and book marking sites.
For example, when parts of the page change, other parts of the page no longer correspond to the new page. This means bookmarks or web browser history will not be able to locate the page in an exact state. Also, the ‘Back’ function will sometimes not work because the URL (Uniform Resource Locater) of the page hasn’t changed, even if sections of the page have. Perhaps the biggest disadvantage of Ajax is accessibility. Not all browsers support JavaScript or XMLHttpRequest. XMLHttpRequest also prohibits the display of information from another server. For security, it only displays information from the server that responds to the initial requests.