Professional Documents
Culture Documents
Internet Applications
Alessandro Bozzon
alessandro.bozzon@polimi.it
Piero Fraternali
piero.fraternali@polimi.it
Sara Comai
sara.comai@polimi.it
Giovanni Toffetti Carughi
giovanni.toffetti@polimi.it
ABSTRACT
This paper addresses conceptual modeling and automatic
code generation for Rich Internet Applications, a variant of
Web-based systems bridging desktop and thin-client Web
interfaces. We show how classical Web modeling concepts
are not enough to capture the specificity of RIAs, extend an
existing Web modeling language, and provide an implementation of a CASE tool for visual modeling and code generation from RIA-aware specifications. Experimentation of the
proposed approach in real-world scenarios is also reported.
Categories and Subject Descriptors: D.2.2 [Software
Engineering]: Design Tools and Techniques, computer-aided
software engineering (CASE), evolutionary prototyping, user
interfaces, H.4.0 [Information Systems Applications]: General, H.5.4 [Information Interfaces and Presentation]: Hypertext / Hypermedia architectures, navigation, theory, user
issues
General Terms: Design.
Keywords: Rich Internet Applications, Web Engineering,
Web Site Design.
1.
In the last years the Web has become the reference platform for the development of all sorts of integrated business
solutions. Due to the increasing complexity of these applications, current Web technologies are starting to show
usability and interactivity limits. The user experience in
thin-client Web applications is not comparable to desktop
interfaces, responsiveness is lower due to network overhead
and unnecessary round-trip server access, and disconnected
usage is not supported [6].
Rich Internet Applications (RIAs) have been recently proposed as the response to the abovementioned drawbacks [7].
They provide sophisticated interfaces for representing complex processes and data, while minimizing client-server data
transfers and moving the interaction and presentation layers from the server to the client. However, RIAs lack development methodologies and CASE tools catering for their
specificity, notwithstanding the number of existing methodCopyright is held by the author/owner(s).
ICWE06, July 11-14, 2006, Palo Alto, California, USA.
ACM 1-59593-352-2/06/0007.
2.
3.
RELATED WORK
Research companies such as IDC and Gartner had foreseen the advent of Rich Internet Applications already in
2003 (see e.g., [7]) while industrial trends confirm the growth
of their acceptance among developers [12]. Tool vendors
have adapted to RIA requirements their existing solutions
Feature
C/S,
Desktop
Web
RIA
NO
Complex
Rich
YES
YES
NO
NO
YES
YES
YES
Simple
Limited
YES
Limited
YES
YES
NO
NO
YES
Simple
Rich
YES
YES
NO
NO
YES
YES
4.
CASE STUDY
Dimension
Traditional Web
RIA modeling
Modeling
Data Modeling
Constructs
E-R, UML class diaE-R, UML class diagrams
grams
Persistence
server
(database,
server (database, session),
levels
session)
client
Relationship server
server, client, inter-layer
types
Hypertext Modeling in the large
Constructs
site views, areas,
site views, areas, pages
pages
Page types
server pages
server and client pages
Hypertext Modeling in the small
Constructs
server content units,
server and client content
server operations
units and operations
Selector
server-side
server and client-side
Ordering
server-side
server and client-side
CDs from the main list. The shopping cart is kept at the
client side; it can be transformed into a purchase order or
discarded at the end of the session. As illustrated in Figure
2, the user interface of the case study runs at the client for
most of the functionalities, and the server is invoked only
for fetching CD information, requesting or saving the wish
list, and checking out the shopping cart into an order.
5.
OVERVIEW OF WEBML
6.
6.1
Data modeling
In traditional data-intensive Web applications content resides solely at the server-side, either in the form of database
tuples or of main memory objects contained in server-side
Credit Card
OID
Expire Date
Number
User
Shipping Address
1:1
OID
1:1
1:N
1:N Email
Password
Username
1:N
OID
Address
1:N
0:N
1:1
Wish Item
0:N
Shipping Method
OID
Name
Cost
1:1
1:1
1:1
Order
1:1
Review
1:1
Customer
OID
1:1
CD
0:N OID
Artist
Label
/Track-number
Price
Review Release Date
Title
Order Item
1:1
0:N
1:1 OID
Total
OID
Text
OID
/CDTitle
OID
C
0:N
0:N
1:N
/CDTitle
1:1
OID
Rate
Title
1:1
Track
Recommended CD
OID
Cart Item
OID
/CDTitle
0:N
1:1
Editorial Review
Wish Item
1:1 OID
0:N
OID
Position
Title
Cart
OID
/Total
/Item-number
sen by the user and store it in the database only when the
user confirms all answers). Relationships connecting entities
belonging to different persistence levels are called inter-layer
and must be stored at the layer with shorter duration. For
example, if the shopping cart items are stored with client
persistence to be updated locally and refer to CDs stored in
the database, the relationship between cart items and CDs
must be stored with client persistence, so that relationship
instances be automatically eliminated when the application
terminates, unless the user explicitly decides to save them
(e.g., by confirming the order).
The data model of the case study. Figure 4 shows the
data model of the case study, with persistence specifications.
Client-side entities and relationships are marked with a C,
whereas inter-layer relationships are inferred from the persistence level of the involved entities (one client-side and one
server-side). The following design decisions have been taken:
a) the User, ShippingAddress, ShippingMethod, Order, and
CreditCard entities are given database persistence, because
users must register permanently before issuing orders. Similarly, the CD, Review, and Track entities (and their IS-A
descendants) are stored in the database; b) the shopping
cart and the wish list must be created and/or manipulated
at the client side; therefore, the entities Cart, CartItem, and
WishItem are given client persistence; c) the client entities
CartItem and WishItem are connected by an inter-layer relationship to the database entity CD, to enable looking up
the full details of the CD stored in the database; d) the user
may decide to save permanently his wish list and make it
available to other users. Therefore, entity WishItem is duplicated with database persistence.
The choice of separating the client and database WishItem
entities privileges the applications usability, because the
user will be able to create and modify the wish list at the
client side, without invoking the server at each update. Conversely, the client entity Cart is not replicated on the server,
because it lives only at the client. Instances of the client
entity CartItem become instances of the server entity OrderItem, after check out.
Data modeling guidelines. The data model for RIAs
blends pure data requirements with design choices aimed at
improving usability and/or performance, inferred from the
6.2
Hypertext modeling in the large specifies the general structure of the front-end: it associates site views to user groups
and organizes each site view into areas that aggregate pages
with a homogeneous purpose. Pages may be complex and organized in a hierarchical structure composed of nested pages.
From the technological standpoint RIAs have a different
physical structure than traditional data-intensive Web applications: the former typically consist of a single application
shell (e.g., a Java applet or a FLASH movie), which loads
different data and components based on the users interaction. The latter consist of multiple independent templates,
processed by the server and simply rendered by the client.
However, the hypertext modeling metaphor remains a good
description of the dynamics of the interface also for RIAs,
especially in the case of hybrid applications, which comprise
a mix of traditional page templates and RIA components.
The notion of page must be extended, to cope with the specificity of RIAs. Intuitively, pages, or fragments thereof, can
be produced either at the server-side or at the client-side.
The conceptual model must express this difference, because,
as we will see in the next subsections, the content and operations that can be associated with a page may depend on
the type of page.
The following concepts capture the two types of pages found
in RIAs and their organization.
Server pages: they represent traditional Web pages; content
and presentation are calculated by the server, whereas rendering and event detection are handled by the client. Events
are processed at server-side3 .
Client pages: they represent pages incorporating content or
logics managed (at least in part) by the client. Their content
can be computed at the server or client side, whereas presentation, rendering and event handling occur at the client
side. Events can be processed locally at the client or dispatched to the server.
Page AND-OR tree: represents the nesting of (client/ server)
sub-pages within pages. AND-siblings are computed in one
shot and normally displayed together, whereas OR-siblings
3
Here by event we mean the triggering of some business
logic, not a presentation event like a mouse over effect.
C CdStore Demo
CDDetails
Alternative Main Page
Search
Shopping
Cart
CDInfo
Recommended
Cds
Wish List
Alternate Details
Editorial
Review
Tracks
Customer
Reviews
CheckOut
Alternative CheckOut
Shipping Address
Alternative Address
Shipping Edit
Address Shipping
Address
Payment Method
New
Address
Alternative Payment
Payment Edit
Payment
Method
Method
New
Method
Shipping
Method
Complete
Order
6.3
C
Search CD From
Catalog
CDList
K: string
Price Filter
Min: float
Max: float
Min
Max
[Title contains K] [
CD
Price >= Min] [
Content unit modeling guidelines. As for pages, content unit specification has a different flavor in traditional
Web applications and RIAs. The following guidelines apply
in the RIA context: 1) When a unit draws content from a
server entity, the type of selector conditions must be decided
by trading-off between efficiency and usability. Pushing selection to the server reduces the data transmitted to the
client, but slows down refined filtering due to server roundtrip. Selection on the client ensures smoother filtering at
the price of initial data loading overhead. Mixed selectors
(like those exemplified in Figure 7) can be used to reach
the optimal balance. 2) When data are naturally sorted
in only one way, evaluating ordering clauses at the server
improves efficiency. When data admit alternative sorting
criteria, equally meaningful to the user, then multiple ordering clauses should be used, delegating to the server the
most frequently used one.
6.4
Operation modeling
CD Details
CD Details
Create Item
ConnectToCD
OK
C
CD
CartItemToCD
CartItem
OK
Export Cart
Items
Xml
Create Order
OK
OK
Import Order
Items
Xml
Cart
OK
Order
when they have to be manipulated client-side without invoking the server at each update (e.g., the wish list is loaded
from the server for disconnected client-side manipulation);
2) client-side data must be transferred to the server for permanent storage or for subsequent use by other users (e.g.,
the shopping cart items are sent to the server to be associated to the order). Data transfer leverages two WebML
operations, first introduced for data transfer from/to Web
Services [10]: XMLIn and XMLOut. The former takes in input a piece of XML data, structured according to a canonical
XML Schema5 , and stores it into a set of entities and relationships; the latter does the reverse operation: it exports
a set of entity and relationship instances into a canonical
XML fragment. As an example of bulk client-to-server data
transfer, consider the creation of an order from the items
in the shopping cart (Figure 10). From the Total page the
user may see the total price of his cart and, by navigating the
outgoing link of the ShoppingCart data unit, trigger a chain
of operations. The ExportCartItems client XMLOut unit
extracts the shopping cart items from the client entity CartItem; the server CreateOrder operation produces a new instance of the server-side Order entity; the ImportOrderItems
operation stores the shopping cart items into the OrderItem
entity and connects them to the order instance, received as
input parameter6 . This is an example of mixed client/server
operation chain: the first operation is marked as client; the
next operations are performed server-side. Notice that, in
general, transactional properties are not applicable to mixed
operation chains, as this would require a distributed transaction manager comprising the client, which is incompatible with the asymmetry of HTTP and unrealistic also when
symmetric protocols are used. However, it remains possible to define transactional server or client blocks inside an
operation chain. In Figure 10, a transaction (denoted as a
dashed rectangle) is defined for the server operations.
Operation modeling guidelines. As for page and content modeling, design guidelines and constraints apply to operation modeling too, including the bulk transfer of content
between tiers as a special case. In case of mixed client/server
5
operation chains, server and client operations should be grouped according to their type (when possible) to minimize the
client-server round-trips and to allow transactional blocks.
In the example of Figure 10, all the server operations are
performed consecutively. Client operations acting on temporary data should precede (when possible) server operations acting on permanent data. This guarantees a simpler
recovery in case of failure of one of the operations of the
sequence.
As a concluding remark, we observe that data access and usage at the client side can be modeled in three decreasingly
sophisticated ways: with client entities, with server entities
published in client pages, and with purely server pages. In
the first case, disconnected filtering, sorting, and manipulation are possible; the second choice allows disconnected
filtering and sorting, but not offline manipulation; the third
option does not permit disconnected work on the data.
7.
Configuration File:
- Action Mapping
Client
Browser
Flash Plug-In
Controller
(Script)
H
T
T
P
Model
Descriptors
Business Logic
View
(Lzx Components)
Unit Services
Controller
(servlet)
View
(JspTemplate)
http
Page Services
Operation Services
XmlHttp
State
Objects
Auxiliary Services
Servlet Container
S
e
r
v
e
r
Business Logic
Model
Page Services
Unit Services
Actions
Operation Services
Validation Services
HTML +
Custom Tags
Descriptors
State
Objects
Auxiliary Services
XML +
Custom Tags
Data Tier
8.
9.
REFERENCES