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

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

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

nal design. Moreover, when the whole client applicati<strong>on</strong><br />

is implemented in JavaScript <strong>on</strong>ly and using a programming<br />

model that we are familiar with from the desktop,<br />

it allows easy adopti<strong>on</strong> of proven software patterns and<br />

best practices.<br />

7) Easier testing. <strong>Web</strong> applicati<strong>on</strong>s are traditi<strong>on</strong>ally<br />

difficult to test automatically. There are all kinds of tools<br />

that do help this process but still they are far from writing<br />

simple unit tests for a code that does not have user<br />

interface, let al<strong>on</strong>e HTTP c<strong>on</strong>necti<strong>on</strong>. The partiti<strong>on</strong>ed<br />

way of implementing web applicati<strong>on</strong>s does not itself<br />

help in testing the user interface but testing the RESTful<br />

API can be very easy. Some frameworks – such as<br />

Django – offer a way to write unit tests against the REST<br />

API without even having to start a web server when the<br />

tests are run. Even if the framework does not have such<br />

support, automatic regressi<strong>on</strong> tests would still be fairly<br />

easy to write using isolated HTTP request and checking<br />

the resp<strong>on</strong>se codes and possible c<strong>on</strong>tents.<br />

8) Network traffic. When the user interface is implemented<br />

within a single page, there is no need to download<br />

any additi<strong>on</strong>al HTML or CSS files after the applicati<strong>on</strong><br />

has been bootsrapped and running. Only the data<br />

that is requested by the user is downloaded from the<br />

server. Thus, there is no overhead in the network traffic<br />

and from this follows that the user interface stays resp<strong>on</strong>sive<br />

at all times and therefore becomes more robust.<br />

On the other hand, when the services <strong>on</strong> the server c<strong>on</strong>form<br />

to the RESTful architectural style, the full caching<br />

capabilities of the HTTP become available. In many of<br />

the traditi<strong>on</strong>al web applicati<strong>on</strong>s the payload data is embedded<br />

within the downloaded HTML page. That makes<br />

the data much more difficult – if not even impossible –<br />

to cache efficiently.<br />

5.2 Disadvantages<br />

1) Framework support. <strong>Web</strong> frameworks offer a lot of<br />

c<strong>on</strong>venti<strong>on</strong>s, tools and code generators for building traditi<strong>on</strong>al<br />

web applicati<strong>on</strong>s. While the RESTful service interface<br />

can benefit from these tools, the single page user<br />

interface gets no benefit. The level of guidance the developer<br />

gets for building the user interface is completely<br />

dependent up<strong>on</strong> the chosen JavaScript toolkit.<br />

2) Search engines. It is very difficult for the search<br />

engines to crawl a single page web applicati<strong>on</strong>. They<br />

could crawl the RESTful service interface but the documents<br />

returned by the interface are without any c<strong>on</strong>text<br />

and therefore difficult to rank.<br />

3) Accessibility. For visually impaired, single page<br />

web applicati<strong>on</strong>s can be difficult to use. In traditi<strong>on</strong>al<br />

web applicati<strong>on</strong>s with more static pages the accessibility<br />

is easier to take into account. While possible, it is much<br />

more laborious to implement a web applicati<strong>on</strong> that has<br />

good support for accessibility.<br />

4) Lack of HTML. One of the best features of HTML<br />

and CSS is that web pages can be designed and even<br />

written by graphical designers. In single page web applicati<strong>on</strong>s,<br />

with heavy use of JavaScript, this becomes<br />

impossible. The user interface must be implemented by<br />

a software developer.<br />

6 Related Work<br />

As menti<strong>on</strong>ed earlier, our approach embraces many of<br />

the existing methods and patterns. We now briefly describe<br />

some of these existing approaches and underline<br />

how our soluti<strong>on</strong> stands out am<strong>on</strong>g them.<br />

6.1 MVC in <strong>Web</strong> Applicati<strong>on</strong>s<br />

While there are other approaches into building web applicati<strong>on</strong>s<br />

– such as c<strong>on</strong>tinuati<strong>on</strong>s [6, 13] – the MVC<br />

pattern is the <strong>on</strong>e adopted by most of the popular web<br />

frameworks today. There has been a lot of research <strong>on</strong><br />

how to implement the MVC pattern in the realm of web<br />

applicati<strong>on</strong>s. Specifically, [12] defines and discusses all<br />

the different scenarios of how the MVC pattern can be<br />

implemented in web applicati<strong>on</strong>s. The paper elaborates<br />

<strong>on</strong> how the MVC pattern should be incorporated by Rich<br />

Internet Applicati<strong>on</strong>s (RIAs). It is also their c<strong>on</strong>clusi<strong>on</strong><br />

that while the comp<strong>on</strong>ents of MVC may be distributed<br />

differently in different types of applicati<strong>on</strong>s, for RIAs, it<br />

is best to implement the full MVC stack in the browser.<br />

Another paper [10] suggests a dynamic approach of<br />

distributing the comp<strong>on</strong>ents of MVC between the client<br />

and the server. This is accomplished through a method<br />

called flexible web-applicati<strong>on</strong> partiti<strong>on</strong>ing (fwap) and<br />

it allows for different partiti<strong>on</strong>ing schemes without any<br />

modificati<strong>on</strong>s to the code. For example, depending <strong>on</strong><br />

the use case it may be appropriate to sometimes deploy<br />

c<strong>on</strong>troller <strong>on</strong> the server while at other times it is best to<br />

have it in the browser.<br />

However, for all the popular MVC web frameworks –<br />

such as Struts, Rails or ASP .Net MVC – the term MVC<br />

always refers to the traditi<strong>on</strong>al way of partiti<strong>on</strong>ing web<br />

applicati<strong>on</strong>s (as described in Secti<strong>on</strong> 2). In this model<br />

the whole MVC stack is implemented in the server and<br />

the view is transferred into the browser after being generated<br />

in the server. Of course, the view may have dynamic<br />

features through the use of JavaScript and CSS<br />

but it does not affect how the comp<strong>on</strong>ents of the MVC<br />

are laid out.<br />

6.2 RESTful <strong>Web</strong> Services<br />

For a web site that supports both browser based user<br />

interface and programmable API, it is comm<strong>on</strong> to<br />

have, indeed, two separate interfaces for these purposes.<br />

Good examples are Netflix (http://www.netflix.com/)<br />

and del.icio.us (http://del.icio.us/) which both have separate<br />

interfaces for browser and other clients. Usually the<br />

96 <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> <str<strong>on</strong>g>USENIX</str<strong>on</strong>g> Associati<strong>on</strong>

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

Saved successfully!

Ooh no, something went wrong!