Engineering Web Applications Architectur
Engineering Web Applications Architectur
The popularity of the World Wide Web has been increasing ever since its
birth in the early 1990’s. It rapidly became an important medium for content
providers to publish documents for the masses. In the beginning, the content
was delivered in the form of static pages but more interactive applications
were soon to follow. The birth of e-commerce and other online services
created a demand for better and more feature rich applications. However,
web standards were not able to meet these requirements in a timely fashion
which led to a situation where browser makers and web developers were
forced to partially disregard to the standards to fulfill the market demand.
When compared to traditional desktop application development, browsers
provided a much more restricted environment for web applications. This
meant that most of the application logic had to be implemented on the
server, forcing the developers to break applications into client and server
side components. The advent of Ajax enhanced the responsiveness of web
applications, but it also created even more incoherency into the development
process by moving application logic into the client. As a result, most web
applications mix and match both approaches with little consistency.
In this thesis, the focus is on the high level architecture of web applica-
tions. Our goal is to bring proven software engineering principles into web
development and thereby increase software maintainability, reusability, and
developer productivity. Additionally, we discuss web services and show how
web applications can benefit from them. We examine the architectural weak-
nesses present in most of today’s web applications and elaborate on how they
are crippling the development process. We also present an architecture that
addresses these shortcomings and provides a coherent way for developers to
design and build web applications.
To perform fine grained analysis and verification of our observations, we
have applied the presented architecture on multiple real world web applica-
tions. We have used the experiences and feedback from these applications
to steer our research. The background, implementation, and findings of this
effort are reported in detail in this thesis.
i
ii
Acknowledgements
The work presented in this thesis was carried out during the years 2008-
2012. During the first two years I was part of a talented group of enthusias-
tic researchers at Tampere University of Technology. While continuing my
research work, during the last two years I had the opportunity to conduct
my research findings in the industry at Stratagen Systems. All this work
would not have been possible without the help and support of the people
acknowledged hereby.
First of all and mostly I would like to thank my supervisor, Professor
Tommi Mikkonen for his continuous and immediate support for my research.
He provided me with the funding, tools, facilities, and guidance to carry
out my research work during tight schedules and difficult research questions.
Whenever I was inching, he pushed me forward. His help was restricted
neither by his office space nor his office hours.
I would also like to thank my colleagues at the University. Dr. Antero
Taivalsaari, who guided me during the early stages of my research work and
introduced me to scientific research. Furthermore, I would like to thank Mr.
Janne Lautamäki and Mr. Tuomas Turto who – in their own way – gave me
inspiration and strength to carry on whenever I was in doubt. It was during
those years that we shared a room in the university when I was though how
to conduct research properly. Those were also the years I consider as being
the most fun and educating during my professional career.
At Stratagen Systems I would like to thank my superior, Mr. Jari-Pekka
Frantsi for allowing me to take time off to proceed with my research work.
Next, my gratitude goes to my long-term colleague and friend Mr. Peitsa
Turvanen, who is in great extent responsible for allowing me to execute the
findings of my research work in the industry. Jari-Pekka and Peitsa have
both shown me trust in our pursuit for the new application platform for
Stratagen. Last but not least, at Stratagen, I would like to thank the boys
in the corner office; Mr. Rami Salminen and Mr. Veli-Matti Aho for their
insightful feedback and lengthy discussions about my work as well as other
”topical” questions.
iii
iv
Janne Kuuskeri
Contents
1 Introduction 1
1.1 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Thesis Questions . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.3 Contributions . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.4 Terms and Definitions . . . . . . . . . . . . . . . . . . . . . . 4
1.5 Research Method . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.6 Structure of the Thesis . . . . . . . . . . . . . . . . . . . . . . 8
v
vi CONTENTS
3.3.2 Maintainability . . . . . . . . . . . . . . . . . . . . . . 31
3.3.3 Reusability . . . . . . . . . . . . . . . . . . . . . . . . 32
3.3.4 Productivity . . . . . . . . . . . . . . . . . . . . . . . . 32
3.3.5 Responsiveness . . . . . . . . . . . . . . . . . . . . . . 33
3.4 Conclusions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5 Related Work 51
5.1 Domain Specific Languages . . . . . . . . . . . . . . . . . . . 51
5.1.1 Mawl . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.1.2 WebDSL . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5.1.3 A DSL for Generating Web Applications . . . . . . . . 53
5.2 XFormsDB . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
5.3 Lively Kernel . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
5.4 Google Web Toolkit . . . . . . . . . . . . . . . . . . . . . . . . 55
5.5 Ruby on Rails . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
5.6 Meteor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
6 Conclusions 59
6.1 Introduction to Included Publications . . . . . . . . . . . . . . 60
6.2 Thesis Questions Revisited . . . . . . . . . . . . . . . . . . . . 61
6.3 Future Work . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
6.3.1 Access Control . . . . . . . . . . . . . . . . . . . . . . 62
6.3.2 Coherency to Building Single Page Applications . . . . 63
6.3.3 Distributed Notifications . . . . . . . . . . . . . . . . . 63
6.3.4 Server Side Rendering . . . . . . . . . . . . . . . . . . 63
7 Bibliography 65
List of Included Publications
[v] Janne Kuuskeri, Tuomas Turto, On Actors and the REST. In Pro-
ceedings of the 10th International Conference on Web Engineering
(ICWE’2010, Vienna, Austria, July 5-9, 2010), Springer LNCS 6189,
pp.144-157.
vii
viii CONTENTS
Chapter 1
Introduction
The World Wide Web was originally conceived as a platform for sharing
documents. These documents could easily be published and linked together
to constitute a network of web pages that we have become to know as the
web. The immediacy and easy accessibility of web pages was very appealing
to users and made the web an instant success. However, it quickly became
evident that the web as an application platform has a lot more to offer than
just acting as a document database. The interest to deliver working software
over the web, and to run it inside the browser was imminent.
At first, user interactivity was added into web pages by using rendering
techniques that enabled dynamic composition of web pages. This enabled
modest interactions like the use of forms and server side programming but
also dynamic capabilities on the client side. Even though these sites were
not really called web applications back then, the transformation from mere
web pages towards true web applications had started.
In many respects, web applications have come a long way. User expe-
rience in today’s modern web applications is much better while the func-
tionality provided is manifold compared to early days of web applications.
The standards – namely HTML5 [31] [133] and APIs it is associated with
(e.g. Web workers [32], Web storage [35], Microdata [33], and Canvas [54])
– have evolved over time to better facilitate web applications, and browser
vendors have invested in making browsers true application platforms instead
of just being document viewers. Lately, we have also seen the emergence of
platforms such as Firefox OS (formerly known as Boot to Gecko)1 where the
browser environment takes the role of the operating system and where so
called native applications are built with web technologies [124].
All this has resulted in web applications that are feature rich, dynamic,
1
http://www.mozilla.org/b2g/
1
2 CHAPTER 1. INTRODUCTION
collaborative, and responsive. In other words, they have many of the features
that we have come to know from desktop applications. No more is JavaScript
[48] used as a pocket knife to quickly hack a feature into a web page, but
increasingly large and complex applications are built with it.
1.1 Motivation
By current standards, web applications are inherently complex to develop
and maintain [51, 15, 83]. They are run on many different environments
such as desktop and mobile browsers, and are expected to perform equally
well on all of them. Also, bearing in mind the history of web applications,
it comes as no big surprise that they are crippled by the environment that
was not originally designed for them. Had the standards of the web and
browsers been designed from the ground up to facilitate web applications as
opposed to web pages, the development process and tools would most likely
look different today.
Another complicating factor is that the constant transformation of web
platform has left little room for the inclusion of any general conventions or
guidelines on how to build web applications. This leaves programmers at
the mercy of the frameworks, which yet poses another set of problems. The
hundreds of available frameworks all come with a different set of trade-offs
regarding security, performance, provided conventions, and the development
model in general. Different frameworks are good for different things, and
many of the frameworks differ to a great extent in how they steer or even
mandate the development model. Programmers may not always understand
the trade-offs and the risks that frameworks entail. Moreover, programmers
become dependent upon the frameworks, leaning on the utilities they provide
while ignoring or not understanding what is actually happening underneath.
Many of the frameworks also encourage coupling the client and the server
components tightly together. It is this kind of coupling that makes code and
programmers’ skill set reuse very difficult.
Even with a suitable framework for a given task, there is still a lot of
leeway for the programmer to implement the application in various ways. A
good example of this is the fragmentation of the application logic. On one
hand it is fragmented over the server side components running in the server
and the client side components running in the browser. On the other hand
it is fragmented over different technologies including multiple programming
languages and presentation templates that may all be used to implement
the application logic. Furthermore, the communication channel between the
server and the client is very versatile. The programmer must choose how to
1.2. THESIS QUESTIONS 3
• Application logic: Which parts of the system should handle the ap-
plication logic? How can we partition the application logic between the
client and the server so that the code stays maintainable and software
architecture consistent?
• Thick or thin client: Should web applications have a thick client that
handles most of the user interactivity within the browser or should
2
http://www.joelonsoftware.com/articles/LeakyAbstractions.html
4 CHAPTER 1. INTRODUCTION
By finding answers to these questions in full, we are able reach our goal.
The goal is not to implement yet another framework for building web ap-
plications, but to provide guidelines and conventions, essentially a design
approach, on how to build complex web applications in general. However,
we do consider it important that these practices are validated in real world
applications, so a validating industrial-scale implementation is therefore one
of our goals, too.
1.3 Contributions
The main contribution of the thesis is in the presentation and evaluation of
a design approach for building feature rich web applications. We pinpoint
the problems burdening today’s web development and present an approach
to tackle these issues. As part of the design approach we introduce a set of
guidelines and conventions for building web applications. These guidelines al-
low developers to build maintainable and reusable web application code that
can also benefit from proven software patterns [55]. The presented approach
is investigated and discussed in detail. Moreover, it is evaluated in real world
applications. The evaluation process and its outcome are documented in this
thesis.
In the course of this process, we have also made contributions to the open
source software. We have made minor contributions to a number of existing
projects but more importantly we have implemented and open sourced REST
frameworks for two different platforms. The first one3 is implemented as an
extension to the Django [40, 63] framework, and the other one4 is a library
for the asynchronous Twisted [126, 88] networking engine.
3
https://github.com/wuher/devil/
4
https://github.com/wuher/diablo/
1.4. TERMS AND DEFINITIONS 5
Web service. A service that defines its access point in the web and there-
fore operates on top of HTTP. A web service provides an interface for its
clients that they can use remotely over the network. The W3C identifies two
major classes of web services: REST-compliant web services which expose a
uniform set of stateless operations and arbitrary Web services which expose
an arbitrary set of operations for the client [24]. SOAP usually falls under
the latter category. A user interface may be built on top of web service (i.e.
it may use the web service) but the definition of web service does not include
graphical user interface.
that embed the browser runtime allowing the application to be built with
web technologies but still be shippable as a native application.
Programmatic client. A client that does not necessarily have any end-
users or even a user interface. It can be for example a script, a batch process
or another web service.
Research
approaches
Approaches Mathematical
studying reality approaches
Researches Researches
stressing stressing utility of
what is reality artifacts
Conceptual-
Approaches for Artifacts- building Artifacts- evaluating
analytical
empirical studies approaches approaches
approaches
Theory-testing Theory-creating
approaches approaches
We have been investigating the current state of web applications and sug-
gested an approach defining how these applications should be architectured.
Furthermore, we have built several web applications, web services and even
frameworks to be able to evaluate our approach. For these reasons, our re-
search methods include artifacts building approaches and artifacts evaluating
approaches.
Artifacts building approach tries to answer the question whether it is
possible to build the artifact and how it should be built? Artifacts evaluating
approach, on the other hand, tries to answer the question about the artifact’s
efficiency. Both of these approaches also fall under broader method called
Action research [121]. In our thesis we have answered and analyzed both of
these problem domains.
Web as an Application
Platform
2.1 Introduction
As an application platform, the web has a lot to offer. The coverage of In-
ternet access has allowed the web to become ubiquitous thereby making web
applications easily accessible [11]. Indeed, one of the most powerful features
of the web as an application platform is the immediacy of it; once something
is published in the web, it is immediately accessible to everyone [134]. This,
in turn, enables seamless updates and easy deployment. Granted, the re-
cent emergence of various online distribution networks (namely, App Stores)
has bridged the gap between the web and native applications when it comes
to distribution of applications. Also, there are applications such as Google
Chrome1 that constantly update themselves in the background and without
user interruption over the web. However, these channels still introduce an
1
http://www.google.com/chrome/
9
10 CHAPTER 2. WEB AS AN APPLICATION PLATFORM
extra level of indirection for the users and the application manufacturers
compared to using purely the web and its main protocol, HTTP.
newer version of the application without even being aware of it. Furthermore,
she may do so using a different browser or a different computer at a different
location or even a mobile device and still have access to the same application.
One more thing to notice in the example is that the user does not need
to install anything, a URL is enough. Moreover, the application is platform
independent; users may use their choice of device, operating system, and
browser to access and use the application. This is emphasized even more
by the fact that HTTP is the prevalent protocol in the web and therefore
rarely blocked by firewalls or proxies. These same benefits apply to other
scenarios too. For example, if we think about web services; regardless of the
application level protocol that is used, underneath web services usually run
on top of HTTP and therefore clients utilizing it may all use their choice of
programming languages and libraries for consuming the service.
Programmatic access via web services has become an important part of
web applications. Many popular web sites like Twitter2 , Facebook3 , and
Tumblr4 provide an API for third party clients to build their own applications
on top of the provided web service. These web services provide an access to
the same data as the applications themselves have, thereby making it possible
for third party clients to create mashup applications on top of the available
data.
5
http://www.programmableweb.com/
2.2. PROGRAMMING WEB SERVICES 13
XML-RPC
2%
JavaScript
6%
SOAP
21%
REST
70%
2.2.1 SOAP
SOAP is a part of the service-oriented architecture (SOA) family of tech-
nologies. It is just one of the many technologies involved in SOA, but in
the context of this dissertation, it is the most interesting one. To be able to
describe SOAP and its features better, we will first provide an overview of
SOA itself.
SOA
SOA is a set of principles and methodologies for designing and developing
software in the form of interoperable services. SOA helps in building appli-
cations in terms of modularized and loosely coupled software components.
These components are implemented as web services that provide information
and functionality to other applications [84]. New and complete applications
may then be built by combining one or more of these web services. Indeed,
one of the key ideas behind SOA is that service providers may advertise
their services in centralized service registries, from which service consumers
are able to find them and then connect to appropriate services directly.
Many technologies are involved in the SOA architecture. In Figure 2.2
we have depicted some of these along with involved actions and stakeholders.
Service providers formally define the interface to the service they are exposing
14 CHAPTER 2. WEB AS AN APPLICATION PLATFORM
using the Web Service Description Language (WSDL) [27]. The service may
publish this description into a service registry using Universal Description
Discovery and Integration (UDDI) protocol [98]. If a service consumer does
not know about the service provider directly, it also can use the UDDI in
finding the service from the service registry. Finally, the consumer uses SOAP
(formerly Simple Object Access Protocol ) to interact with the web service.
All of the aforementioned SOA technologies rely on XML [28] and its schema
validation (XSD) [25] for communication and description of services.
SOAP
SOAP is a protocol that can be used on top of HTTP to implement Remote
Procedure Call (RPC) [12] [125] style of communication between the client
and the server. In its simplest form, SOAP is a way to exchange typed
messages over a network and therefore it is independent of the used transport
layer and supports for example, HTTP, SMTP [72], TCP [96], and JMS
[111, 110]. Since the scope here is HTTP, we are examining SOAP in the
context of HTTP only. HTTP is also the dominant transport used for when
building SOAP services. The way RPC manifests itself in SOAP is that
the client wraps its intention into a message, sends it over the HTTP to
the server, which then interprets the message and executes the requested
operation.
The default message format in SOAP is XML, and in the case of HTTP,
POST method is used to carry the message over to the server. The XML
document contains the information about the function and its parameters
the client wishes to invoke. The server decodes this information, executes
2.2. PROGRAMMING WEB SERVICES 15
the function, and then returns the output of the function in another XML
document to the client. In SOAP, these XML messages are called Envelopes
[26]. An example of two SOAP messages – request and response – are given in
Listings 2.1 and 2.2, respectively. In the example, the client wishes to perform
a basic addition of two numbers by invoking a function called addNumbers.
SOAP is a part of a wide set of standards for defining web services. These
are informally referred to as the WS-* stack [132], [2]. The WS-* stack in-
cludes (but is not limited to) standards for messaging, service description,
16 CHAPTER 2. WEB AS AN APPLICATION PLATFORM
XML schema and security. When defining web services utilizing SOAP, the
most important standards are SOAP itself, XML schema, and WSDL. WSDL
is used to formally define the interface; the functions it exposes, the param-
eters these functions accept and their return types. Leveraging these stan-
dards, SOAP enjoys vast and complete tool and library support. Graphical
tools may be used for defining the interface and generating the WSDL doc-
ument. The WSDL document, on the other hand, may be consumed by a
different tool to generate the code for the server and client implementations.
This way, when working with SOAP environment, tooling is able to hide all
the networking details from the programmer.
To summarize, SOAP raises the level of abstraction in the HTTP envi-
ronment by implementing another protocol on top of HTTP. By doing so, the
interface exposed by the web service looks more like a traditional RPC inter-
face and may be consumed as such. The fact that it comprises namespaces
and functions means that it conforms more directly to concepts familiar from
programming languages. Therefore, software architects usually feel comfort-
able in utilizing SOAP and defining service oriented interfaces. Also, they are
free to steer the architecture of the application independently of the HTTP’s
stateless and resource oriented model.
2.2.2 REST
While SOAP is a protocol, REST is an architectural style built around the
idea of Resource Oriented Architecture (ROA) [41] [99]. RESTful interface
and its implementation are tied to resources as opposed to modules and
functions. These resources are exposed by the servers and consumed by the
clients using the standard HTTP methods. A resource is accessed via a URL,
and its state is transferred using its representation. A key characteristic of a
RESTful interface is the clear division of application state between the client
and the server.
Much like SOAP, REST is also independent of HTTP and can be deployed
on top of other protocols besides HTTP. In practice, however, RESTful ar-
chitecture is very rarely used without HTTP. Moreover, REST was originally
designed hand-in-hand with HTTP itself and therefore embraces HTTP’s key
concepts. Because it is also our interest to investigate REST in the HTTP
environment, we consider RESTful interfaces only in the context of web ser-
vices. In the following we present the key characteristics of REST. For the
most part, these descriptions are extracted from Publication [v], but it is
worth repeating them here for describing the technical contributions of this
thesis.
2.2. PROGRAMMING WEB SERVICES 17
Methods of REST. For RESTful services, the most commonly used HTTP
methods are POST, GET, PUT and DELETE. These methods define the ba-
sic CRUD6 operations for resources. These methods can be categorized in
accordance to how they operate on resources. The GET method is said to
be safe because it has read only semantics on the resource, implying that
it is meant only for information and data retrieval without any side effects.
With PUT and DELETE, GET is also idempotent, since it does not matter
whether the operation is applied once or several times on a resource. The
end result is always the same. For instance, it does not make a difference if
a resource /blog/2010-02-09 is deleted once or twice; it will not exist
afterwards.
future request made by the client. Each request should happen in complete
isolation from any other request.
In the SOAP example we did not include any information about HTTP
headers, the request method, or event the URL that was used as a service
endpoint. In the case of REST, however, we deliberately included this infor-
mation to emphasize the point that REST conforms to HTTP, and at the
protocol level is HTTP.
2.3. PROGRAMMING WEB SERVICE CLIENTS 19
Browser
View
Controller Model
Server
of the application, while the controller is responsible for handling and routing
the requests and generating the view for the browser. This is a radical sim-
plification of the responsibilities of these components, but again, this is not
our focus here. Our focus is on the sequence of events that occur repeatedly
when the user interacts with the application. For example, when user clicks
a button, a request is sent to the server, and the server handles the request,
generates the application user interface from scratch, and sends it back to
the browser. Figure 2.4 illustrates the process of page generation.
Because HTTP is a stateless protocol, it separates the states of the
client and the server. Therefore, from client’s perspective, the application
is restarted every time a new page is generated and sent to the client. The
server, on the other hand, needs to remember the state of the application
in the beginning of each request. Normally, this is achieved via server side
sessions, where the client sends a cookie with each request to identify the ses-
sion on the server that should be restored. We have explained this sequence
and its implications in more detail in included Publication [vi].
After the web page is received and rendered by the browser, it can be fairly
static. User interactivity and partial page updates can be added by using
JavaScript, but most of the web frameworks encourage and steer developers
into handling the business logic and user interactions in the server. This kind
of programming model results in thin clients where pages are loaded from the
server each time the user navigates into a different view or performs actions
that require data or operations from the server.
2.3. PROGRAMMING WEB SERVICE CLIENTS 21
Server
Controller
Template engine
HTML template
...
Model <ul>
{% for row in data % }
Person: <li>{{data.name}} is {{data.age}} years old</li>
string name, {% endfor %}
int age </ul>
...
Neither approach causes the web page to reload and at the same time
both approaches update the URL of the application in browser’s address
bar. Hence, both approaches enable bookmarkability and history support.
However, there is one key distinction in these two approaches when used as a
bookmark: the anchor part of the URL is never sent to server and therefore in
the hashbang-approach the server never sees which page the client is actually
requesting and cannot perform any optimizations.
In single page web applications, the MVC pattern may be fully imple-
mented inside the web page using JavaScript. The view modifies the DOM
2.3. PROGRAMMING WEB SERVICE CLIENTS 23
tree dynamically to present different views of the user interface. The con-
troller on the other hand intercepts users actions and uses the model to
perform necessary actions. Lastly, the model defines the domain model of
the application and transfers the data between the client and the server.
This way the application remains active in the browser all the time and is
not restarted as there are now page reloads. After the application has been
loaded from the server it does not need to download any further HTML,
the server is used only for data access and messaging. This arrangement is
depicted in Figure 2.5.
Browser
View
Controller Model
Server
API
Figure 2.5: MVC pattern in single page web applications. (Thick client)
Many of the plug-in based solutions for implementing user interfaces for
web applications follow the above approach. Solutions like Adobe Flash7 ,
Java Applets8 , and Microsoft Silverlight9 all make it easy to write thick clients
and encourage writing single page web applications. Especially Adobe Flash
has gained a lot of popularity over the years, and its development model has
been proven easy and productive. These plug-ins are proprietary technologies
and therefore make them less interesting research topics for us. However, they
are something we can learn from and also consider how we can apply their
best features in our research with open standards.
7
http://www.adobe.com/fi/products/flashplayer.html
8
http://docs.oracle.com/javase/tutorial/deployment/applet/
9
http://www.microsoft.com/silverlight/
24 CHAPTER 2. WEB AS AN APPLICATION PLATFORM
2.4 Summary
We can consider HTTP as the lowest common nominator for building web
services with different technologies. REST embraces HTTP and utilizes its
features – like authentication, cacheability, addressability, and resource ori-
entation – to full extent. On the other hand, RESTful interfaces also need to
be designed with this in mind; they must conform to the uniform interface
defined by the methods of HTTP. SOA, in turn, offers an object-oriented
programming (OOP) [14] approach into building web services; the interface
consists of classes and methods instead of resources. In SOA, the communi-
cation protocol is commonly implemented using SOAP and while this raises
the level of abstraction and provides an RPC style of programming model on
top of HTTP, it also largely ignores the properties of HTTP. SOAP services
usually build around a single URL and use only the POST method [66] for
passing messages. Also, in contrast to REST and HTTP, the WS-* fam-
ily of standards define their own methods for things like authentication and
caching.
One of the standards introduced by WS-* stack is business process exe-
cution language (BPEL). It may be used for defining and executing actions
between web services, thereby making it an orchestration language [103].
Paper [82] introduces a similar concept in the context of Web 2.0 [97] and
mashup applications by introducing a component model for mashup appli-
cations and an architecture that extends the SOA model with mashup com-
position. However, the complexity of these approaches has driven developers
into using custom methods for composing mashup applications. Depending
on the utilized web service, mashup applications are either composed on the
server (thin client) or in the browser (thick client).
Chapter 3
So far we have described commonly used approaches for building web services
and web applications. In this chapter, we present our proposed architecture
for building web applications in a way that combines applications and services
into an entity that brings together the best of both worlds. The presented
approach will address the questions and goals of this thesis. Furthermore, by
combining web applications and web services, the resulting application will
automatically entail a web service for programmatic access too. We call this
approach the decoupled way of building web applications.
In contrast, most of the web applications today are thin client applica-
tions. They may employ Ajax techniques to make them more dynamic and
thicker but they still do full and partial page loads where the payload data is
embedded within the HTML. This tightly couples the client and the server,
and the server needs to maintain the state of the application and restore
that state every time a new request comes in. This creates predefined paths
of the application control-flow between the client and the server and makes
reusability very difficult. We call this approach the traditional way of building
web applications.
25
26 CHAPTER 3. ENGINEERING COMPLEX WEB APPLICATIONS
tainability. From these, we can further derive a set of lower level goals. Most
importantly, making it easier for the developers to follow proven software
engineering principles like modularization, responsibility assignment and in-
formation hiding. Granted, these are goals that are good objectives for any
software project, but as we will demonstrate in the following sections, they
hold for web applications in particular. Similar topics are discussed in more
detail in [92] and [19]; here we will only cover the ones that are most relevant
to this thesis.
3.1.1 Modularity
Modularity refers to logical partitioning of software into smaller parts called
modules [101]. Each module hides its internal implementation and all com-
munication with other modules occurs via a well- defined interface. There-
fore modules are self-contained and interchangeable without having to modify
other parts of the software. Along with modularity, principles like separation
of concerns [39] and information hiding [102] are proven to be foundations
for long-lasting software designs.
In traditional web applications with thick clients, modularity is problem-
atic to implement. The logic and functionality is spread over many different
parts and layers of the application depending on the factors like network la-
tency, browser capabilities, and cacheability. This kind of fragmentation and
random optimization blurs the responsibilities of the modules that comprise
the very application. Eventually, module borders are penetrated or put down
completely. This is amplified by the fact that the application logic – imple-
mented in JavaScript (in the browser) or in another language on the server
– is usually mixed with the presentation (HTML and HTML templates).
One of the most important goals of our architecture is to address this
incoherency by introducing and even enforcing a set of rules and guidelines
to bring consistency into responsibility assignment.
3.1.2 Maintainability
From the poor ability to assign responsibilities follows poor maintainability.
In Mythical Man Month [71], Fred Brooks claimed that “The total cost of
maintaining a widely used program is typically 40 percent or more of the cost
of developing it”. However, several sources estimate even bigger numbers for
the cost of software maintenance [100] [37]. The importance of maintainabil-
ity increases with the size of the software. Not only does good maintainability
ensure that changes to the software become easier but it also protects the
architecture from being corrupted over time.
3.1. ENGINEERING GOALS 27
Many frameworks provide conventions for structuring the code and cat-
egorizing different layers of the application. However, these conventions do
not help developers in being coherent in their decisions when building the
application. They may start with the default architecture endorsed by the
framework, but as the application evolves they may seemingly randomly
abandon the original layout and make ad-hoc modifications to the applica-
tion and still adhere to the conventions set by the framework. So, even when
playing by the rules of the framework, code base can end up being difficult
to maintain. Together with the ability to better assign responsibilities for
web applications, we also seek better maintainability for them.
3.1.3 Reusability
Reusability is an important aspect of any real life application [7]. Reusability
refers to software artifacts that may be used in more than one context [113].
An artifact in this case may be, for example, a software module, a component,
or even an application. A precondition to software reusability is modularity
and well defined interfaces.
Reusability has a special role in the field of web applications because the
web offers a platform for not just applications but also services. Therefore,
the functionality implemented in the server should be reusable and not tied to
the one application using it. But even in smaller scale, reusability has been
problematic in web applications because of the fragmented nature of the
code base. One of the goals of our design is to enhance reusability by making
web applications reusable without compromising the overall architecture or
simplicity.
3.1.4 Productivity
Productivity refers to software development methods that increase the qual-
ity and quantity of code produced by a programmer. Measuring productivity
is a problematic topic and it has been covered by several studies (such as [70]
and [1]). Firstly, productivity can be affected by many factors, and secondly
the quality of the produced code should be estimated as well. In this thesis
we only focus on estimating how our proposed architecture can help pro-
grammers become more productive than they would be with a traditional
approach.
Some of the cross-cutting concerns of web can decrease the productivity of
development. Web applications are run on top of HTTP which is a stateless
protocol and at the same time in the traditional thin client approach, web
pages are reloaded into the browser frequently. A common solution to this
28 CHAPTER 3. ENGINEERING COMPLEX WEB APPLICATIONS
problem has been the use of cookies and server side sessions. This means,
however, that the client needs to send the cookie with every request and
the server needs to find and restore the session for each request it receives.
Much of this can be automated by frameworks but there still remains a lot
of boilerplate code for the developers to write in order to fully restore the
state of the application on each request.
Furthermore, developers need to decide how to partition their applica-
tions. They need to carefully think which user events should be handled
by the client and which ones by the server. Parts of the functionality may
be implemented in the client using JavaScript, some parts in the HTML
templates, while most of the functionality is implemented in the server side
programming language. There are many things for the developers to think
about and implement besides the actual application logic. Not only can this
misdirect the architecture of the application and lead into fragmented and
unmaintainable end result but it can also dramatically decrease the developer
productivity.
3.1.5 Responsiveness
3.1.6 Conclusion
We believe that developing web applications should be simpler. In fact, sim-
plicity is considered as one of the characteristics that software architectures
should aim at in general [36]. The developers should be able to focus on the
application that they are building and not be distracted by the additional
cross-cutting concerns of the web, like session management and application
partitioning. Furthermore, when building web applications that are complex,
these issues become even more important. By addressing these issues with
our proposed architecture we are able to provide an environment for the de-
velopers where they can be productive and develop web applications more
like they would develop any other software.
consumable by other applications. There are situations where the data may
still be embedded in the HTML that is dynamically loaded into the browser,
or the data maybe available outside of HTML but it is exposed through a
set of ad-hoc URLs that may have unpredictable side effects. In other words,
the data that the server possesses is not designed to be accessed outside of
the application that it was originally exposed for.
The decoupled architecture is depicted in diagram (c). In this scenario,
the browser application uses the API directly without any indirections. The
data is available to the client the same way that it is available to any other
client and there are no artificial ties between the client and the server com-
ponents.
data API
App data
model and the view within the client to carry out users actions. The model
– which also lives inside the client – is the only component contacting the
server. It does so by issuing asynchronous HTTP requests to the server when
and only when it is necessary.
3.3.1 Modularity
By its very nature, REST is strictly stateless; there are no cookies or server-
side sessions. From the perspective of responsibility assignment, this means
that the client-side application alone is responsible for storing the state of
the application. The server is only responsible for storing the states of the
resources it exposes. This gives us a very clear separation of concerns. The
browser application becomes an application in its own right, using the server
only when it needs to. The server in turn does not need to know anything
about client applications and their states. Modularity can then be further
defined within each side individually, and no module is fragmented over the
network.
The division of responsibilities in web applications is discussed in further
detail in Publication [i], where we present our guidelines for partitioning web
applications. Publication [v], on the other hand, discusses the modularization
of RESTful interfaces via the use of actor model of computation.
3.3.2 Maintainability
When the application is clearly separated into two autonomous components,
those components have their own architecture and development cycle and
therefore they may also be maintained separately. When separated, not
only are the maintained components smaller but also their responsibilities
become better defined. This helps in keeping the code base maintainable
and adaptable.
In Publication [vi] we have examined maintainability improvements of
decoupled web applications in more detail. We covered areas such as local-
ization, testability, and error handling and also provided experiences from
real world applications.
32 CHAPTER 3. ENGINEERING COMPLEX WEB APPLICATIONS
3.3.3 Reusability
Web applications that follow the proposed design architecture already expose
a RESTful service API that can be reused as such. In the traditional thin
client approach the server side interface makes assumptions about its clients.
Because the state of the application is stored in the server side session and the
data is embedded inside HTML documents, the client is not able to consume
the server interface freely. In the decoupled approach the client application is
able to consume the services without any predefined application control-flow
and thus becomes much more versatile. New applications may be created on
top of the same API but also existing application may be transferred on top
of a different implementation of the same service API. This way both client
applications and the server interface become reusable.
In publication [vi] we investigated the reusability improvements when
breaking the application into two parts. These improvements were examined
from both, the client’s viewpoint and the server’s viewpoint.
3.3.4 Productivity
The development of the RESTful web service and the client side application
can take place in isolation as long as the interface definition is agreed upon.
The absence of server side sessions and application state allows the server
to be developed as any other web service. In Publication [i] we outlined
the guidelines for code partitioning between the client and the server. The
conclusion was that web applications should be implemented as much as
possible in the client. To automate code partitioning for web applications
that are written in JavaScript (also server-side parts), we implemented a code
inspector that dynamically executed parts of the application on the server
and parts of the application in the client.
This approach was taken further in Publication [iv], where we turned
code partitioning into a REST-inspired middleware ([16], [136]) implemented
in CommonJS1 . There, the middleware would intercept each request that
was loading a JavaScript file, inspect the parts that needed to be run on
the server, turn them into RESTful resources, and then inject the returned
JavaScript code with proxies to these resources. While it still holds that web
applications should have a thick client, we have left the idea of automatic
code partitioning as a future research topic. The interface that the server
exposes should be a well behaved RESTful interface translating into domain
models of the application instead of an interface whose resources translate
1
CommonJS specifies a set of JavaScript APIs for different JavaScript runtimes and
libraries to implement
3.4. CONCLUSIONS 33
3.3.5 Responsiveness
The decoupled approach encourages in writing single page web applications.
This can mean increased initial load time, but after the application is loaded,
single page web applications can be much more responsive than traditional
web applications because the user does not need to wait for the page to load
but only for the data to appear. This way, the user interface stays responsive
even when data is being loaded from the server.
In Publication [ii] we examined various ways to make applications with
a lot of JavaScript to load faster. This would mean starting the application
with a minimal amount of JavaScript code and then dynamically loading the
rest of the code later. We discussed the advantages and disadvantages of
various approaches and presented our own suggestion for a new primitive to
load JavaScript into the browser environment.
3.4 Conclusions
By following the decoupled approach of building complex web applications,
software architects and developers are able to focus on the design and archi-
tecture of the web application that they are building. They can lean on the
proven software engineering principles and patterns when designing the ar-
chitecture for the client and the server individually. Frameworks and toolkits
should not try to hide HTTP by introducing abstractions on top of it but to
embrace it. By clearly acknowledging the HTTP, building a RESTful API on
top of it and making it available to client side applications will separate the
concerns of web applications and make the responsibility assignment explicit.
34 CHAPTER 3. ENGINEERING COMPLEX WEB APPLICATIONS
Chapter 4
An important aspect for this research was the utilization and verification of
the decoupled approach in industrial setting. From early on, we have had a
unique opportunity of working closely with a company that is in the process
of transforming its core components and applications to be web compati-
ble. It is in their interest to utilize the web as an application platform for
distributing applications but also to provide programmatic access for their
systems. Moreover, as we will explain in the following, reusability of the
applications and the programmatic interface is a key factor when moving
forward with the transition. Our research work has been carried out hand in
hand with this company, and the experiences and conclusions of the trans-
formation process towards the decoupled architecture are documented in this
chapter.
4.1 Introduction
The company we have been working closely with, Stratagen Systems, is a
United States based company, which has offices also in United Kingdom
(Mobisoft UK) and Finland (Mobisoft). Stratagen provides end-to-end soft-
ware for paratransit. Paratransit is a form of flexible passenger transporta-
tion, where routes and schedules are usually not fixed. Stratagen has dozens
of installations in United States, UK, Sweden and Finland. The degree of
flexibility that a paratransit agency offers varies greatly between these in-
stallations. Typically, the fleet of vehicles comprises mini-buses and shared
taxis, but other types of vehicles, such as normal taxis, are also used.
At the high level of abstraction, paratransit has three different types of
actors: passengers, drivers and dispatchers. There are other actors such
as service providers, vehicle operators and funding agencies, but recognizing
35
36 CHAPTER 4. INDUSTRIAL SCALE CASE STUDY
these three actors is enough for the scope of the thesis to provide good enough
overview of the application domain. These actors are presented in Figure
4.1. Stratagen provides software for each of these actors to communicate
throughout the process.
Dispatcher
Paratransit
System
Passenger
Driver
Driver. Drivers use mobile applications that run on the devices that are
either handheld or mounted into the vehicle. Using these applications drivers
are able to see the route they should be driving and the passengers that need
to be picked up. The application is also used for reporting back to the
paratransit system and letting it now how a route progresses.
Problem 1: Two Core Systems. In general, the two core systems have
very similar characteristics; they both provide end to end solutions in the field
of paratransit. They both have different applications for different tasks and
they both have various server side components to handle complicated tasks
such as routing algorithms, vehicle allocation and vehicle communication.
Despite of these commonalities both systems are developed in isolation from
each other. Moreover, there is very little geographical overlap because the
other system is developed and used mainly in North America and the other
one in Europe.
4.3 Re-engineering
In order to make best use of company’s resources these two systems should
be merged into one. It must be recognized that this will be a long process
and cannot happen all at once. Instead, the transformation into one system
is incremental and both existing systems will need to continue to co-exist
during this process. In addition to moving towards one system, there is a
strong interest in utilizing the web as much as possible. This means building
more web applications instead of native desktop applications.
In short term, these two systems should be able to support same appli-
cations; applications that are built to be used globally in conjunction with
both systems. For example, any new development – may it be an application
for end users or an interface for a third party – should be implemented so
that it can be used in both systems. In an environment where the systems
are only conceptually connected, this kind of effort requires a lot of planning.
was gained from this process by the teams is the realization that not all
concepts have been clear nor well defined even within these systems. These
incompatibilities can then be worked on and the domain model ironed out to
make it work for both systems as they are moving forward. The refinement
of the domain model is an ongoing process as is the design of the software
architecture itself; both will be improved iteration by iteration.
A A B B
A System A A B System B B
A A B B
AB AB AB
Interface / API
A B
System A System B
A B
A B
uct family will be more concise and may share similar look and feel. When
more applications are implemented on top of the interface and old ones be-
come obsolete, also the underlying systems can start to migrate safely behind
the interface (see Figure 4.4). Indeed, the ultimate goal is to fully merge these
two systems into one, and when that happens, only one implementation of
the interface is needed as shown in Figure 4.5. There are various approaches
into architecting this merger but discussing them falls outside the scope of
this thesis. Our goal here is to define the high level architecture for this kind
of transition in web environment and to demonstrate how the decoupled
approach supports this transition.
AB AB AB AB
Interface / API
System A System B
AB AB AB AB
Interface / API
System AB
HTTP and therefore also REST – being closely associated with it – allows
web applications to consume the interface directly from the browser. It is
the lowest common nominator for applications using the web as a platform.
HTTP is also widely supported among various devices and platforms, and it
provides built-in support for authentication, security and caching.
AB´ AB´´
Interface / API
Porting Applications
At the time of writing, there are five single page web applications that have
been implemented on top of the RESTful interface. Two of them are new
applications, one is an old web application and two are old native applica-
tions. On top of these there are two programmatic clients implemented by
third parties that are consuming the interface.
When new applications are built or existing ones ported to conform to
the decoupled way of building web applications, the following questions need
to be asked:
1. What functionality does the application require from the server (i.e.
what is it that cannot be done in the client)?
After these questions have been answered to and necessary resources im-
plemented into the interface, the application may be implemented as a single
page web application. The applications implemented so far use a varying set
of JavaScript libraries and tools but they all share the same characteristics:
they all make heavy use of JavaScript and they are all built around the MVC
46 CHAPTER 4. INDUSTRIAL SCALE CASE STUDY
pattern. Some of the applications employ JavaScript libraries that allow them
to be written entirely in JavaScript thereby making the development expe-
rience similar to traditional desktop programming. Regardless of the tools
and libraries, the decoupled architecture lowers the barrier for developers not
familiar with web development to start building web applications.
Mobile Applications
Out of all the applications built so far, two are mobile applications. One is an
application originally implemented for desktop browsers and the other one
was built from the ground up to be mobile only. The one that was originally
implemented for desktop browsers, was optimized to be mobile friendly by
using CSS Media Queries [57]. Thus, the mobile version of the application
has all the same features as the desktop version and is used with the device’s
browser by navigating to the corresponding URL. The application has been
tested with many of the more recent mobile devices and even though it has
a rich set of functionality, there has been very little performance problems.
The other application was built with Sencha Touch [115, 73] and Phone-
Gap [105, 131] to look more like a native application that can be installed on
the device. Even though the browser is not visible to the user in this case, it
is still the runtime environment for the single page web application. Initially,
the application was a lot of transitions and animations in the user interface
but as the application was tested with more low-end devices, the decision
was to leave them out to improve performance.
4.4 Evaluation
In order to evaluate the applicability of the decoupled architecture we did
several comparisons and interviews inside the company. Based on the goals
set for the suggested approach and this thesis, we came up with a set of ques-
tions that we wanted to present to the interviewees and a set of comparisons
we wanted to do with the applications. We interviewed several developers
and architects about the development model in general. Our sample was
small; only five developers, but it was still beneficial to see whether there is a
trend in the answers. Four of the interviewees had several years of experience
in web development while one developer was fairly new to web development.
Here are the questions that were asked:
When comparing the decoupled approach to the traditional thin client ap-
proach of building web applications,
server side implementation, tests can be written for both individually. The
server API can be tested without the client and the client can be tested
without the server. Multiple answers stated that significantly more tests
were written with the decoupled approach.
Aside from the answers, it should be noted that while most existing test
tools are meant for testing traditional thin client applications, the tools for
testing single page applications are evolving rapidly. A good example of
this is the AngularJS [3, 74] library, which supports Test-Driven Develop-
ment (TDD) [8] of single page applications. Because SPAs run fully in the
browser, many of their features can be tested without the server. Tests for
the server (REST API), on the other hand, may either be written using the
tools provided by the server side framework or as a separate test application
which sends HTTP request to the API and checks the results. Therefore de-
velopers have better access for writing automated tests for web applications
and more bugs can be detected without the help of the test team.
4.5 Discussion
At the time of writing, there are two implementations of the RESTful inter-
face, one for each system. They both implement their own set of resources
which are partially overlapping. Both implementations are still far from being
complete but they are already able to support several single page web appli-
cations. Even though there are many resources that are only implemented
in either system, the domain model that these implementations are based
on is agreed upon and therefore the implementations can safely progress in
different order. These interfaces can be thought of as being Anti-Corruption
Layer s [44] to the underlying systems; they mask the quirks of legacy sys-
tems and keep the interface itself clean and according to the agreed domain
model.
The transformation towards global reusability and one common interface
has brought the teams working on different systems closer together. They
are starting to speak the same language via the mutually agreed domain
model and the development efforts for new applications are gradually being
spread across the teams. So far, there is only one application that can be
used on top of either interface, but this is purely a business decision as
opposed to a technical one. The applications are still very new and they
have been implemented based on a customer request and market demand.
North America and Europe have different customers and therefore requests
for new features and applications do not always go hand in hand. However,
this has been more a matter of prioritization in marketing and development
4.5. DISCUSSION 49
and not a question of whether the applications will be used on top of both
systems. This will take place eventually as the implementation of these
interfaces progresses.
Even when the two systems are technologically incompatible, by follow-
ing the decoupled way of implementing web applications, the company has
quickly been able to reuse client applications on top of both systems. The
decoupled approach has also increased the productivity for developing new
applications and interfaces for third parties. This is mainly because of the fact
that the web applications consume the RESTful API directly and therefore
share the same resources with other applications and programmatic clients.
This increase in productivity has also been acknowledged by the management
as they have witnessed new applications being delivered quicker than before.
Some of the applications that have been implemented on top of the REST-
ful interface have drawn interest even outside the teams working on the two
paratransit systems. For example, a taxi system – whose domain model is
not too far from paratransit’s – can reuse an application originally built for
a paratransit system by implementing the required subset of the interface.
This kind of reuse that spans over the application domains bears even more
value to the company.
Based on the positive results and strong endorsement by the management,
Stratagen will continue to apply the decoupled approach of implementing web
applications. It will keep on evolving the domain model and the RESTful
interface specification of the one common paratransit system. Moreover,
the two interface implementations are actively being developed as new web
applications are implemented on top of them. Behind the interface, the
transformation of the two core systems has also been started by introducing
a first common service that both systems can utilize.
50 CHAPTER 4. INDUSTRIAL SCALE CASE STUDY
Chapter 5
Related Work
In this chapter we examine topics that are related to our research and this
thesis. These topics share similar goals as our work; they seek to unify and
bring coherency to web application development. There exists a great deal
of research around REST and web services but we want to examine existing
research work and tools that address web development on a level that deals
with full web applications, both server and client, and not to revisit the
architectural level discussion given earlier in Chapter 2.
Similarly, there has been several studies on finding a modeling language
for Rich Internet Applications, WebML [20] being one of the more popular
ones. Specifically, in [107] Preciado et al. define the modeled features of
RIAs and give comparison of existing methodologies to do so. Again, we are
not going to go into details of these approaches, since their focus is more
on the code (or other artifacts) generation for a single web application and
not on the reusability, architecture and development model. Furthermore,
many of them seem to be more suitable for modeling traditional thin client
applications.
51
52 CHAPTER 5. RELATED WORK
5.1.1 Mawl
Created already in 1995, Mawl [77] is the oldest DSL for building web ap-
plications. It is targeted directly for form-based services [5] because at that
time HTML forms were the only way to build interactive web applications.
In Mawl, user interactions are modeled as traditional user input and output
actions. Here, a web page is considered as being the input and output for a
sequential program that runs on the server. Developer wrote the service logic
using the domain specific language along with the user interface in HTML
templates. A separate compiler then processed these files and produces a
series of CGI scripts.
Mawl’s programming model allows it to hide the details of HTTP and CGI
from the developer. Furthermore, it addressed issues like session management
between requests, usage of HTML templates, and HTML and form validation.
Later on, these issues were solved by many other web frameworks. We were
not able to find any recent articles or other activity related to Mawl and
therefore comparing it to our work today is not reasonable.
5.1.2 WebDSL
WebDSL is a domain specific language for web applications with rich data
model [130]. At the time of writing, it is built on top of Seam framework
[114, 140] and Java EE [69]. WebDSL consists of several sub-languages, each
of which are used for a specific task such as user interface, data modeling,
workflow, database querying, validation and access control. Via linguistic
integration [58] these sub-languages can be combined together to have unified
syntax and semantics throughout the application. WedDSL also provides
static consistency checking of web applications [61]. This helps in avoiding
late failures in things like using undefined keys in HTML templates and
broken links because concepts like links and template variables are first class
citizens of the language and can be checked during compilation.
Comparing to our work, WebDSL shares our aspiration in bringing uni-
formity to web development and therefore making it easier to write web ap-
plications. The approach however, is very different. WebDSL is well suited
for traditional form based applications with thin clients. It provides data
binding from forms into models and data validation. It also couples the
client and server tightly together and has no notion of building web services.
Paper [61] elaborates on the benefits of being able to statically check the
consistency of web applications. Our approach also helps in error handling
but by separating the responsibilities of error handling into server and client
components; both parties are responsible for handling errors and always as-
5.2. XFORMSDB 53
sume that the other end may fail or not be reachable. We also believe that
you will always need a comprehensive test suite in any case [118].
5.2 XFormsDB
In Publication [78] Laine et al. presented a server side extension to the
XForms markup language [29] named XFormsDB1 . It is a framework that
allows declarative implementation of web applications based on W3C stan-
dards. Being an extension to XForms, the framework relies on XML docu-
ments and their transformations. The same XML schemas can be used on
the client and on the server for data validation. In XFormsDB, the user
interface is built with Embedded XHTML and XForms without any exten-
sions. The proposed extensions to the XForms language are implemented in
the server where they can by used to implement the application logic and
database queries. Specifically, the database is accessed with XQuery [30],
which is a language for querying and manipulating data in XML documents.
1
https://code.google.com/p/xformsdb/
54 CHAPTER 5. RELATED WORK
5.6 Meteor
Meteor is a platform for building web applications fully in JavaScript. It
offers a unique approach to building web applications by allowing developers
to write JavaScript functions that are run either on the server, on the client
or both. It is targeted for single page web applications and features like
collaboration and data synchronization are built into its core. One of its
distinct features is to provide access to database from everywhere. That is,
developers are able to run the same database queries on the client as they
would on the server.
Meteor achieves these features via its server-side methods and Distributed
Data Protocol (DDP). Server-side methods offer access from client to arbi-
trary JavaScript functions running on the server. DDP on the other hand
solves the problem of accessing and modifying data on the server and then
pushing changes to all clients. Meteor also provides streamlined development
workflow by providing the initial application scaffolding and running its own
development server. The development server uses WebSockets [45] to enable
hot code push during development. This means that whenever a development
file is changed, Meteor automatically pushes code changes into the browser
while the client side of Meteor updates the runtime accordingly.
In many ways Meteor is in line with our approach and we have indeed
investigated similar concepts. For example, in Publication [i] we presented
our implementation of JavaScript functions that run on the server but are
callable from the client. In Publication [iv] we demonstrated how the same
thing could be done automatically at module level. Various methods for
5.6. METEOR 57
Conclusions
59
60 CHAPTER 6. CONCLUSIONS
• Thick or thin client: Because the client becomes responsible for im-
plementing the application logic and the server only provides services,
62 CHAPTER 6. CONCLUSIONS
3. Filtering by row: ability to define which set of data client has access
to. For example, if the client asks for all the orders (GET /orders/),
the server should only return the orders that the client has access to
and not all the orders of the system.
6.3. FUTURE WORK 63
want to be able to give their users the possibility to enter their first tweet as
soon as possible (they call this the ”time to first Tweet”).
Server side rendering mixes data and presentation by composing the page
on the server and is therefore against our approach for providing reusable
API. On the other hand, our proposed architecture does not support server
side rendering which, in some cases, could provide performance optimizations
into page loading. We leave it as a future work to investigate how this
shortcoming could be remedied without sacrificing the reusability of the API
and without compromising the separation of concerns of this architecture.
Chapter 7
Bibliography
[2] Gustavo Alonso, Fabio Casati, Harumi Kuno, and Vijay Machiraju.
Web Services: Concepts, Architectures and Applications. Springer Pub-
lishing Company, Incorporated, 1st edition, 2010.
[5] David L. Atkins, Thomas Ball, Glenn Bruns, and Kenneth Cox. Mawl:
A domain-specific language for form-based services. IEEE Trans.
Softw. Eng., 25(3):334–346, May 1999.
[6] Luciano Baresi, Franca Garzotto, and Paolo Paolini. From web sites to
web applications: New issues for conceptual modeling. In StephenW.
Liddle, HeinrichC. Mayr, and Bernhard Thalheim, editors, Conceptual
Modeling for E-Business and the Web, volume 1921 of Lecture Notes
in Computer Science, pages 89–100. Springer Berlin Heidelberg, 2000.
65
66 CHAPTER 7. BIBLIOGRAPHY
[11] Daniel Billsus, Clifford A. Brunk, Craig Evans, Brian Gladish, and
Michael Pazzani. Adaptive interfaces for ubiquitous web access, volume
45 Issue 5, pages 34–38. ACM, New York, NY, USA, May 2002.
[12] Andrew D. Birrell and Bruce Jay Nelson. Implementing remote proce-
dure calls. ACM Trans. Comput. Syst., 2(1):39–59, February 1984.
[15] Pearl Brereton, David Budgen, and Geoff Hamilton. Hypertext: the
next maintenance mountain. In Computer, volume 31, pages 49–55.
IEEE Computer Society Press, Los Alamitos, CA, USA, December
1998.
[16] Chris Britton and Peter Bye. IT Architectures and Middleware: Strate-
gies for Building Large, Integrated Systems (2nd Edition). Addison-
Wesley Professional, 2 edition, June 2004.
[17] Juan José Cadavid, Juan Bernardo Quintero, David Esteban Lopez,
and Jesus Andrés Hincapié. A domain specific language to generate
web applications. In CIbSE, pages 139–144, 2009.
[18] Stuart K. Card, Allen Newell, and Thomas P. Moran. The Psychology
of Human-Computer Interaction. L. Erlbaum Associates Inc., Hillsdale,
NJ, USA, 1983.
[19] Richard Cardone, Danny Soroker, and Alpana Tiwari. Using xforms
to simplify web programming. In Proceedings of the 14th international
conference on World Wide Web, WWW ’05, pages 215–224, New York,
NY, USA, 2005. ACM.
67
[20] Stefano Ceri, Piero Fraternali, and Aldo Bongio. Web modeling lan-
guage (webml): a modeling language for designing web sites. Computer
Networks, 33(1):137–157, 2000.
[21] CommonJS. Jsgi. http://wiki.commonjs.org/wiki/JSGI,
2011. [Online; accessed 11-Jun-2013].
[22] World Wide Web Consortium. Xhtml 1.0 the extensible hyper-
text markup language (second edition). http://www.w3.org/TR/
xhtml1/, August 2002. [Online; accessed 8-Jun-2013].
[23] World Wide Web Consortium. Document object model. http://
www.w3.org/DOM/, 2004. [Online; accessed 11-Jun-2013].
[24] World Wide Web Consortium. Web services architecture.
http://www.w3.org/TR/ws-arch/#relwwwrest, 2004. [Online; ac-
cessed 18-Jun-2013].
[25] World Wide Web Consortium. XML schema part 0:
Primer second edition. http://www.w3.org/TR/2004/
REC-xmlschema-0-20041028, October 2004. [Online; accessed
11-Jun-2013].
[26] World Wide Web Consortium. Soap version 1.2 part 1: Mes-
saging framework (second edition). http://www.w3.org/TR/
soap12-part1/, April 2007. [Online; accessed 11-Jun-2013].
[27] World Wide Web Consortium. Web services description language
(WSDL) version 2.0 part 1: Core language. http://www.w3.org/
TR/2007/REC-wsdl20-20070626/, June 2007.
[28] World Wide Web Consortium. Extensible markup language
(XML) 1.0 (fifth edition). http://www.w3.org/TR/2008/
REC-xml-20081126, November 2008. [Online; accessed 3-Jun-2013].
[29] World Wide Web Consortium. Xforms 1.1. http://www.w3.org/
TR/xforms/, October 2009. [Online; accessed 11-Jun-2013].
[30] World Wide Web Consortium. Xquery 1.0: An xml query language
(second edition). http://www.w3.org/TR/xquery/, December
2010. [Online; accessed 11-Jun-2013].
[31] World Wide Web Consortium. Html5. http://www.w3.org/TR/
html5/single-page.html, March 2012. [Online; accessed 3-Jun-
2013].
68 CHAPTER 7. BIBLIOGRAPHY
[45] I. Fette and A. Melnikov. The WebSocket Protocol. RFC 6455, 2011.
[47] Roy Thomas Fielding. Architectural Styles and the Design of Network-
based Software Architectures. PhD thesis, University of California,
Irvine, 2000.
[48] David Flanagan. JavaScript: The Definitive Guide: Activate Your Web
Pages (Definitive Guides). O’Reilly Media, 6th edition, May 2011.
[53] Elisabeth Freeman, Eric Freeman, Bert Bates, Kathy Sierra, and Elis-
abeth Robson. Head First Design Patterns. O’Reilly Media, 1 edition,
November 2004.
[54] Steve Fulton and Jeff Fulton. HTML5 Canvas. O’Reilly Media, second
edition edition, April 2013.
[55] Erich Gamma, Richard Helm, Ralph Johnson, and John Vlissides. De-
sign patterns: elements of reusable object-oriented software. Addison-
Wesley Longman Publishing Co., Inc., Boston, MA, USA, 1995.
[57] Stephen Greig. CSS3 Pushing the Limits. Wiley, 1 edition, 7 2013.
70 CHAPTER 7. BIBLIOGRAPHY
[58] Danny Groenewegen, Zef Hemel, and Eelco Visser. Separation of con-
cerns and linguistic integration in webdsl. IEEE Softw., 27(5):31–37,
September 2010.
[62] Clarence Ho and Rob Harrop. Pro Spring 3. Apress, 1 edition, 4 2012.
[64] Dan Ingalls, Ted Kaehler, John Maloney, Scott Wallace, and Alan Kay.
Back to the future: the story of squeak, a practical smalltalk written
in itself. SIGPLAN Not., 32(10):318–326, October 1997.
[66] Ian Jacobs. Uris, addressability, and the use of http get and
post. http://www.w3.org/2001/tag/doc/whenToUseGet.
html, 2004. [Online; accessed 11-Jun-2013].
[74] Pawel Kozlowski and Peter Bacon Darwin. Mastering Web Application
Development with AngularJS. Packt Publishing, 8 2013.
[75] Glenn Krasner and Stephen Pope. A cookbook for using the model-view
controller user interface paradigm in smalltalk-80. J. Object Oriented
Program., 1(3):26–49, 1988.
[79] Markus Lanthaler and Christian Gütl. Model your application domain,
not your json structures. In Proceedings of the 22Nd International
Conference on World Wide Web Companion, WWW ’13 Companion,
pages 1415–1420, Republic and Canton of Geneva, Switzerland, 2013.
International World Wide Web Conferences Steering Committee.
[80] Simon St. Laurent, Edd Dumbill, and Eric J. Gruber. Learning Rails
3. O’Reilly Media, 1 edition, 7 2012.
72 CHAPTER 7. BIBLIOGRAPHY
[81] Tim Lindholm, Frank Yellin, Gilad Bracha, and Alex Buckley. The
Java Virtual Machine Specification, Java SE 7 Edition (Java Series).
Addison-Wesley Professional, 1 edition, February 2013.
[82] Xuanzhe Liu, Yi Hui, Wei Sun, and Haiqi Liang. Towards service
composition based on mashup. In IEEE Congress on Services, 2007.
[84] Roberto Lucchi, Michel Millot, and Christian Elfers. Resource oriented
architecture and rest. Office for Official Publications of the European
Communities, 2008.
[87] John Maloney. Morphic: The self user interface framework. 1995.
[88] Jessica McKellar and Abe Fettig. Twisted Network Programming Es-
sentials. O’Reilly Media, second edition edition, 3 2013.
[89] Marjan Mernik, Jan Heering, and Anthony M. Sloane. When and how
to develop domain-specific languages. ACM Comput. Surv., 37(4):316–
344, December 2005.
[90] Eric A. Meyer. CSS: The Definitive Guide. O’Reilly Media, third
edition edition, November 2006.
[93] Tommi Mikkonen and Antero Taivalsaari. Creating a mobile web ap-
plication platform: the lively kernel experiences. In Proceedings of the
2009 ACM symposium on Applied Computing, SAC ’09, pages 177–184,
New York, NY, USA, 2009. ACM.
[97] Tim O’Reilly. What Is Web 2.0: Design Patterns and Business Models
for the Next Generation of Software, pages 17–37. Number 65. O’Reilly
Media, 2007.
[98] UDDI Spec Technical Committee Draft Organization for the Ad-
vancement of Structured Information Standards. UDDI version 3.0.2.
http://uddi.org/pubs/uddi-v3.0.2-20041019.htm, Octo-
ber 2004. [Online; accessed 11-Jun-2013].
[103] J. Pasley. How bpel and soa are changing web services development.
Internet Computing, IEEE, 9(3):60 – 67, may-june 2005.
[104] Cesare Pautasso, Olaf Zimmermann, and Frank Leymann. Restful web
services vs. ”big”’ web services: making the right architectural deci-
sion. In WWW ’08: Proceeding of the 17th international conference on
World Wide Web, pages 805–814, New York, NY, USA, 2008. ACM.
74 CHAPTER 7. BIBLIOGRAPHY
[107] Juan Carlos Preciado, Marino Linaje, Fernando Sanchez, and Sara
Comai. Necessity of methodologies to model rich internet applications.
In Web Site Evolution, 2005.(WSE 2005). Seventh IEEE International
Symposium on, pages 7–13. IEEE, 2005.
[112] Leonard Richardson and Sam Ruby. RESTful Web Services. O’Reilly,
2007.
[116] Alok Sinha. Client-server computing, volume 37, pages 77–98. ACM,
New York, NY, USA, July 1992.
[118] Joel Spolsky and Bruce Eckel. The Best Software Writing I: Selected
and Introduced by Joel Spolsky. Apress, 1 edition, June 2005.
75
[120] Simon St. Laurent, Joe Johnston, Edd Dumbill, and Dave Winer. Pro-
gramming Web Services with XML-RPC. O’Reilly Media, 2001.
[121] G.I. Susman and R.D. Evered. An assessment of the scientific merits
of action research, volume 23, pages 582–603. 1978.
[124] Antero Taivalsaari and Kari Systä. Cloudberry: an html5 cloud phone
platform for mobile devices. Software, IEEE, 29(4):40–45, 2012.
[128] David Ungar and Randall B. Smith. Self: The power of simplicity. In
Conference proceedings on Object-oriented programming systems, lan-
guages and applications, OOPSLA ’87, pages 227–242, New York, NY,
USA, 1987. ACM.
[129] Daniel Vaughan. Ext GWT 2.0: Beginner’s Guide. Packt Publishing,
November 2010.
[137] Erik Wilde and Cesare Pautasso, editors. REST: From Research to
Practice. Springer, 2011 edition, 8 2011.
[138] Fan Yang, Nitin Gupta, Nicholas Gerner, Xin Qi, Alan Demers, Jo-
hannes Gehrke, and Jayavel Shanmugasundaram. A unified platform
for data driven web applications with automatic client-server partition-
ing. In Proceedings of the 16th international conference on World Wide
Web, WWW ’07, pages 341–350, New York, NY, USA, 2007. ACM.
[140] Michael Juntao Yuan, Jacob Orshalick, and Thomas Heute. Seam
Framework: Experience the Evolution of Java EE (2nd Edition). Pren-
tice Hall, 2 edition, February 2009.
77
[141] Michal Zalewski. The Tangled Web, A Guide to Securing Modern Web
Applications, pages 46–47. No Starch Press, November 2011.