Analysis and Testing of Ajax-based Single-page Web Applications
Analysis and Testing of Ajax-based Single-page Web Applications
Analysis and Testing of Ajax-based Single-page Web Applications
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Figure 1.7 Screen shot <strong>of</strong> Google Documents, a web-<strong>based</strong> word processor,<br />
spreadsheet, presentation, <strong>and</strong> form application.<br />
connection is established between client/server <strong>and</strong> the server is not required<br />
to maintain any state information from the clients.<br />
This pull-<strong>based</strong> (polling) style <strong>of</strong> interaction, although scalable, has limitations<br />
for applications that require fast data delivery to the clients. Examples<br />
<strong>of</strong> such applications include auction web sites where the users need to be<br />
informed about higher bids, web-<strong>based</strong> stock tickers where stock prices are<br />
frequently updated, multi-user collaboration applications, web-<strong>based</strong> chat applications,<br />
or news portals.<br />
An alternative to the traditional pull-<strong>based</strong> approach is the push-<strong>based</strong><br />
style, where the clients subscribe to their topic <strong>of</strong> interest, <strong>and</strong> the server publishes<br />
the changes to the clients asynchronously every time its state changes.<br />
In 1995, Netscape introduced a method (Netscape, 1995) for pushing data<br />
on the web through HTTP Streaming, by using a special MIME type called<br />
multipart/x-mixed-replace. This method simply consists <strong>of</strong> streaming server<br />
data in the response <strong>of</strong> a long-lived HTTP connection that is kept open by<br />
server side programming.<br />
The push-<strong>based</strong> approach has recently gained much attention, thanks to<br />
many advancements in client <strong>and</strong> server web technologies that make pushing<br />
data from the server, in a seamless manner, possible.<br />
Comet (Russell, 2006) is a neologism to describe this new model <strong>of</strong> web<br />
data delivery. Although Comet provides multiple techniques for achieving<br />
high data delivery on the web, the common ground for all <strong>of</strong> them is relying<br />
on st<strong>and</strong>ard technologies supported natively by browsers, rather than on<br />
proprietary plugins. Generally, Comet (also known as Reverse <strong>Ajax</strong>) applications<br />
rely on <strong>Ajax</strong> with long polling (see Chapter 4) to deliver state changes<br />
to the clients, as fast <strong>and</strong> reliable as possible. Well-known examples include<br />
Chapter 1. Introduction 11