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.
DOM<br />
Client Browser<br />
<strong>Ajax</strong><br />
Engine<br />
Engine<br />
HTTP<br />
Decoder<br />
Encoder<br />
Server App.<br />
UI Comp.<br />
update<br />
update<br />
update<br />
S<br />
update<br />
UI<br />
Push<br />
Client<br />
S<br />
Push<br />
Server<br />
Service<br />
Provider<br />
Legend<br />
Source Update<br />
Subscribe<br />
Channel<br />
Figure 2.5 Proposed push-<strong>based</strong> integration.<br />
2.7 Architectural Constraints<br />
Architectural constraints can be used as restrictions on the roles <strong>of</strong> the architectural<br />
elements to induce the architectural properties desired <strong>of</strong> a system.<br />
Table 2.2 presents an overview <strong>of</strong> the constraints <strong>and</strong> induced properties. A<br />
“+” marks a direct positive effect, whereas a “–” indicates a direct negative<br />
effect.<br />
Spiar rests upon the following constraints chosen to retain the properties<br />
identified previously in this chapter.<br />
2.7.1 <strong>Single</strong> Page Interface<br />
Spiar is <strong>based</strong> on the client-server style which is presumably the best known<br />
architecture for distributed applications, taking advantage <strong>of</strong> the separation<br />
<strong>of</strong> concerns principle in a network environment. The main constraint that distinguishes<br />
this style from the traditional <strong>Web</strong> architecture is its emphasis on<br />
a single <strong>page</strong> interface instead <strong>of</strong> the <strong>page</strong>-sequence model. This constraint<br />
induces the property <strong>of</strong> user interactivity. User interactivity is improved because<br />
the interaction is on a component level <strong>and</strong> the user does not have to<br />
wait for the entire <strong>page</strong> to be rendered again as a result <strong>of</strong> each action. Figure<br />
2.6 <strong>and</strong> Figure 2.7 show the interaction style in a traditional web <strong>and</strong> in a<br />
single-<strong>page</strong> client-centric <strong>Ajax</strong> application respectively.<br />
2.7.2 Asynchronous Interaction<br />
<strong>Ajax</strong> applications are designed to have a high user interactivity <strong>and</strong> a low<br />
user-perceived latency. Asynchronous interaction allows the user to, subsequently,<br />
initiate a request to the server at any time, <strong>and</strong> receive the control<br />
back from the client instantly. The requests are h<strong>and</strong>led by the client at the<br />
background <strong>and</strong> the interface is updated according to server responses. This<br />
42 2.7. Architectural Constraints