29.11.2012 Views

2nd USENIX Conference on Web Application Development ...

2nd USENIX Conference on Web Application Development ...

2nd USENIX Conference on Web Application Development ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Experiences <strong>on</strong> a Design Approach for Interactive <strong>Web</strong> Applicati<strong>on</strong>s<br />

Abstract<br />

Highly interactive web applicati<strong>on</strong>s that offer a lot of<br />

functi<strong>on</strong>ality are increasingly replacing their desktop<br />

counterparts. However, the browser and the web itself<br />

were originally designed for viewing and exchanging<br />

documents and data and not for running applicati<strong>on</strong>s.<br />

Over the years, web pages have slowly been transformed<br />

into web applicati<strong>on</strong>s and as a result, they have been<br />

forcefully fit into an unnatural mold for them. In this paper<br />

we present a pattern for implementing web applicati<strong>on</strong>s<br />

in a way that completes this transiti<strong>on</strong> and creates<br />

a more natural envir<strong>on</strong>ment for web applicati<strong>on</strong>s to live<br />

in. In the pattern, the full MVC stack is implemented<br />

in the client while the server is completely decoupled<br />

via a RESTful interface. We also present experiences<br />

in building an industrial-scale applicati<strong>on</strong> utilizing this<br />

pattern.<br />

1 Introducti<strong>on</strong><br />

Over the recent years, web has become the most important<br />

platform for delivering and running applicati<strong>on</strong>s.<br />

With the ubiquitous web, these applicati<strong>on</strong>s are easily<br />

accessible regardless of place and time and without any<br />

installati<strong>on</strong> requirements, end users have begun to favor<br />

web applicati<strong>on</strong>s over traditi<strong>on</strong>al desktop applicati<strong>on</strong>s.<br />

On the other hand, the rapidly increasing mobile applicati<strong>on</strong><br />

market has proven that web applicati<strong>on</strong>s are not<br />

always loaded <strong>on</strong> demand anymore but they are also being<br />

installed <strong>on</strong> devices.<br />

The fast growth of the web as an applicati<strong>on</strong> platform<br />

has raised the standard for its inhabitants. Rich<br />

and dynamic user interfaces with realtime collaborative<br />

features have now become the norm. Moreover, with the<br />

popularity of social networks, applicati<strong>on</strong>s are expected<br />

to link or embed informati<strong>on</strong> from other web applicati<strong>on</strong>s.<br />

Finally, if the end user is not immediately satisfied<br />

with the web site, she will simply enter a new URL and<br />

start using another similar service. This has lead applicati<strong>on</strong><br />

developers to push the limits of the browser and<br />

the web standards.<br />

Unfortunately, browsers and the standards of the web<br />

have not quite been able to keep up with the pace. There-<br />

Janne Kuuskeri<br />

Department of Software Systems<br />

Tampere University of Technology<br />

Korkeakoulunkatu 1, FI-33720 Tampere, Finland<br />

janne.kuuskeri@tut.fi<br />

fore, applicati<strong>on</strong> developers have been forced to work<br />

around the standards and to do whatever it takes to meet<br />

end users’ demands. The applicati<strong>on</strong> logic and the presentati<strong>on</strong><br />

have gotten mixed in the mayhem of HTML,<br />

CSS, JavaScript and, some server-side scripting system,<br />

say PHP. Within this technology rush, good software development<br />

practices and patterns have been somewhat<br />

forgotten. Without extra attenti<strong>on</strong>, code base gradually<br />

loses clear separati<strong>on</strong> of c<strong>on</strong>cerns and the resp<strong>on</strong>sibilities<br />

of different comp<strong>on</strong>ents become unclear [11]. For<br />

these reas<strong>on</strong>s many web applicati<strong>on</strong>s have become difficult<br />

to scale or even maintain.<br />

In this paper, we describe a pattern for building web<br />

applicati<strong>on</strong>s for scalability both in terms of throughput<br />

and in terms of provided functi<strong>on</strong>ality. The suggested<br />

pattern advises breaking the applicati<strong>on</strong> in two<br />

aut<strong>on</strong>omous parts: a RESTful web service and a single<br />

page web applicati<strong>on</strong> that utilizes it. Following this<br />

pattern will c<strong>on</strong>tribute to having a clean and c<strong>on</strong>sistent<br />

design throughout the applicati<strong>on</strong>, thereby making the<br />

end result easier to test and maintain in general. As a<br />

side effect, the versatility of the applicati<strong>on</strong> is greatly increased<br />

by offering easier adopti<strong>on</strong> for clients other than<br />

browsers.<br />

Neither RESTful interfaces nor single page web applicati<strong>on</strong>s<br />

are new ideas by themselves. However, in<br />

this paper we suggest using the RESTful API directly<br />

from the JavaScript applicati<strong>on</strong> using Ajax requests. The<br />

main c<strong>on</strong>tributi<strong>on</strong>s of this paper are firstly, to describe<br />

the pattern for implementing complex web applicati<strong>on</strong>s<br />

and sec<strong>on</strong>dly, to present experiences from utilizing this<br />

pattern in a real world, large scale applicati<strong>on</strong>. This<br />

applicati<strong>on</strong> is currently in producti<strong>on</strong>, and experiences<br />

listed in the paper are based <strong>on</strong> actual feedback. By providing<br />

experiences and comparis<strong>on</strong> we show the benefits<br />

of the suggested pattern.<br />

The rest of the paper is structured as follows. In Secti<strong>on</strong><br />

2 we examine the main comp<strong>on</strong>ents of traditi<strong>on</strong>al<br />

web applicati<strong>on</strong>s and identify their weaknesses. Next, in<br />

Secti<strong>on</strong> 3, we introduce our pattern for building complex<br />

web applicati<strong>on</strong>s. In Secti<strong>on</strong> 4 we present how to apply<br />

the pattern in a real world applicati<strong>on</strong> and give insight<br />

as to what kind of design the applicati<strong>on</strong> has. Secti<strong>on</strong><br />

<str<strong>on</strong>g>USENIX</str<strong>on</strong>g> Associati<strong>on</strong> <strong>Web</strong>Apps ’11: <str<strong>on</strong>g>2nd</str<strong>on</strong>g> <str<strong>on</strong>g>USENIX</str<strong>on</strong>g> <str<strong>on</strong>g>C<strong>on</strong>ference</str<strong>on</strong>g> <strong>on</strong> <strong>Web</strong> Applicati<strong>on</strong> <strong>Development</strong> 87

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

Saved successfully!

Ooh no, something went wrong!