25.07.2014 Views

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

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

User Interactivity<br />

User-perceived Latency<br />

Network Performance<br />

Rest-<strong>based</strong> Classic <strong>Web</strong> – – – + + + + – +− –<br />

Client-centric <strong>Ajax</strong> + + – + –<br />

ARPC <strong>Ajax</strong> + + + + – –<br />

Push-<strong>based</strong> <strong>Ajax</strong> + + – – + +<br />

Spiar-<strong>based</strong> <strong>Ajax</strong> + + + + +− + – + + +<br />

Simplicity<br />

Scalability<br />

Portability<br />

Visibility<br />

Table 2.3 AJAX configurations <strong>and</strong> properties.<br />

Data Coherence<br />

Reliability<br />

Adaptability<br />

main variations. Using Spiar as a reference point, commonalities <strong>and</strong> divergences<br />

can be identified.<br />

Table 2.3 shows a number <strong>of</strong> <strong>Ajax</strong> configurations along with the induced<br />

architectural properties. The first entry is the Rest-<strong>based</strong> classic <strong>Web</strong> configuration.<br />

While simple <strong>and</strong> scalable in design, it has, a very low degree <strong>of</strong><br />

responsiveness, high user-perceived latency, <strong>and</strong> there is a huge amount <strong>of</strong><br />

redundant data transferred over the network.<br />

The second configuration is the Client-centric <strong>Ajax</strong>. Most <strong>Ajax</strong> frameworks<br />

started by focusing on the client-side features. Frameworks such as Dojo,<br />

Ext, 13 <strong>and</strong> jQuery 14 all provide rich UI widgets on the client, facilitating a<br />

client-centric style <strong>of</strong> interaction in which most <strong>of</strong> the functionality is <strong>of</strong>floaded<br />

to the browser. Generally, an interaction between components that<br />

share the same location is considered to have a negligible cost when compared<br />

to interaction that is carried out through a network (Carzaniga et al., 1997).<br />

This variant provides a high degree <strong>of</strong> user interactivity <strong>and</strong> very low userperceived<br />

latency. There is, however, no support for adaptability as all the<br />

code is <strong>of</strong>f-loaded to the client <strong>and</strong> that makes this variant static in terms <strong>of</strong><br />

code changes from the server.<br />

Frameworks such as GWT, DWR, 15 <strong>and</strong> JSON-RPC-Java 16 support the<br />

Asynchronous Remote Procedure Call (ARPC) style <strong>of</strong> interaction. In this configuration,<br />

all the presentational <strong>and</strong> functional code is <strong>of</strong>f-loaded to the browser<br />

<strong>and</strong> the server is only asynchronously contacted in case <strong>of</strong> a change in terms<br />

<strong>of</strong> raw textual data. Low user-perceived latency, high user interactivity <strong>and</strong><br />

reduced server round-trips are the characteristics <strong>of</strong> this configuration. Even<br />

though the textual data can be dynamically requested from the server, there<br />

is a limited degree <strong>of</strong> adaptability for the presentational <strong>and</strong> functional code.<br />

The fourth configuration is a pure push-<strong>based</strong> interaction in which the<br />

state changes are streamed to the client (by keeping a connection alive), with-<br />

13 http://extjs.com<br />

14 http://jquery.com<br />

15 http://getahead.org/dwr<br />

16 http://oss.metaparadigm.com/jsonrpc/<br />

Chapter 2. A Component- <strong>and</strong> Push-<strong>based</strong> Architectural Style for <strong>Ajax</strong> 47

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!