Académique Documents
Professionnel Documents
Culture Documents
of Web applications:
WebML
Introduction:
table of contents
The scenario of Web application development
Motivations of model-driven Web development
Web Data Modelling
Hypertext Modelling
Content Management Modelling
Practical model-driven development
Data Mapping and Implementation
WebRatio Site Development Studio, a CASE tool for
MDWD
Data-Intensive Web
Applications
A Web-enabled software system whose main
purpose is to publish and maintain large
amounts of data
Interfaces directed to general public
exploratory
browsing-oriented
personalized (1 to 1)
Examples of data-intensive
Web applications
Commerce-oriented
Electronic catalogs, auctions, virtual marketplaces
Content-oriented
Online newspapers, digital libraries
Service-oriented
Order tracking sytems, reservation systems, tourist
information systems
Community-oriented
Portals, message boards, technical communities
One-to-one delivery
myYahoo, myCDNOW,
Advantages of a
model-driven approach
A rigorous modeling approach:
Reduces development efforts (cost and time)
Allows a more structured development process
Produces more usable and coherent applications
Ensures better quality documentation
Grants immediate and low-cost prototyping through
automatic code generation
Requirements
for Web modeling
Expressiveness
Real-life cases should be expressible
Frequently used design patterns should be captured
Ease of use
Intuitive and visual notation
Clear semantics
Consistency checks performed by the system
Implementability
Efficient mapping to physical data structures
Flexible code generation from high-level
specifications
Hypertext
entities,
relationships
structure
navigation + composition +
user model
Presentation
styles
presentation
Model-driven design of
Web applications
1. Data Modelling
http://www.webratio.com
Data Modeling:
Purpose
MODEL
MODEL
Entity2
Entity1
attribute1
SubEntity
MODEL
Relationship role
A relationship role is one of the two directions under which a
relationship can be regarded
Relationship roles have user defined names
E.g.: Relationship Author_Book may have the roles
Role 1: author2book
Role 2: book2author
Author
author2book
Book
Author_Book
book2author
MODEL
Relationship cardinality
For each direction of the relationship, maximum and
minimum cardinality contraints can be specified
E.g. relationship Author_Book
author2book minCard: 0 maxCard: N
book2author minCard: 1 maxCard: N
Author
0..N
Book
1..N
MODEL
ISA hierarchy
A IS-A hierarchy is a special connection between two entities
that implies that one entity (the sub-entity) is a special case
of the other one (the super-entity)
The sub-entity inherits the properties of the super-entity
IS-A hierarchies may have several levels (e.g, book, novel,
thriller..)
Book
Biography
Novel
Thriller
RUNNING CASE
Example:
Acme e-Catalog
Acme is a small furniture company, which sells
products thru stores located all over the world.
Now, ACME wants to build a Web site for
publishing a product catalog and attracting new
customers. The site should include information
about products, special offers, i.e. combinations
of products sold at a discounted price, and
stores. Products are associated to a technical
record. Products may have several enlarged
images.
RUNNING CASE
Combination
0:N
0:N
0:N
Name: string
Code: integer
Price: float
Description:text
Thumbnail:image
Name: string
Price: float
Description:text
Photo:image
0:1
1:1
Tech record
Colors:image
Size: text
1:1
Big image
Description: text
Photo:image
Store
Location: string
Map: image
URL: URL
Email: URL
Model-driven design of
Web applications
2. Hypertext Modelling
http://www.webratio.com
Hypertext Model:
purpose
MODEL
Goals:
Modelling at a high level the front-end of a dynamic
Web application and the interactions with the back
end business logic and data
Using a simple, yet formal, visual notation
Enabling automatic generation of dynamic page
templates and data access and manipulation queries
Hypertext Model:
questions
MODEL
Q1: what is the experience of the site that the user can
achieve?
Q2: how is the hypertext divided into pages served to users?
Q3: what information is published in the hypertext nodes?
Q4: how are the hypertext nodes connected?
A1: siteviews
A2: pages
A3: content units
A4: links
MODEL
INDEXUNIT
MULTIDATAUNIT
entity
[Selector]
entity
[Selector]
entity
[Selector]
SCROLLERUNIT
MULTICHOICE
HIERARCHICAL
entity
[Selector]
entity
[Selector]
entity
[Selector]
Content:
instances of
an entity
Selector:
set of
conditions
ENTRYUNIT
MODEL
Author
first name:XXX
last name:YYY
photo:
INDEXUNIT
All Authors
S. Ceri
P. Fraternali
O.Versand
ENTRYUNIT
SCROLLERUNIT
Browse Authors
Fname
Lname
MULTIDATAUNIT
Index of Authors
MULTICHOICE HIERARCHICAL
Choose Authors
5/12: go to 1/12
Ceri
Fraternali
Versand
Books&Authors
1. Web Applicat.
Ceri
Fraternali
2. Systems
Tannenbaum
MODEL
Content Units
A WebML unit is the atomic information publishing
element
unitX
container
MODEL
IN
OUT
entity
[selector (par 1, .., parN)]
A unit may need some context to be computed
Each unit exposes input and output parameters
Input is required to compute the unit itself
Parameters pre-defined for the unit +
Other parameters required by the selector of the unit
Output can be used to compute other unit(s) depending on the
current unit
Navigation:
contextual links
source unit
MODEL
target unit
Author
Author
MODEL
Example of links
Which authors books?
Which book?
p2
p1
Author
[OID=p1]
Author
first name:James
last name:Joyce
photo:
p3
Book
[author2book(p2)]
Books of YYY
Ulysses
The Dubliners
Portrait...
Book
[OID=p3]
Book
Title:Ulysses
Price:23$
Cover:
MODEL
Link Parameters
param
Author
Book
[Author2Book(param)]
MODEL
Example:
Author
Book
[Author2Book]
MODEL
Example:
Author
Book
[author2book]
Book
10
MODEL
Automatic Links
source unit
target unit
Author
Author
MODEL
Transport Links
source unit
target unit
Author
Book
[Author2Book]
DataUnit
params
MODEL
OID
Entity
[selector(params)]
Data units
Publish information about ONE SINGLE INSTANCE
The container is an entity with (optional) selector
Input:
OID of the object to be published, OR
Parameters requested for the computation of the
selector, like:
Attribute values
OID of object participant to a relationship role
Output:
OID of the published object (and its attributes)
11
RUNNING CASE
Product page
Product
Information
about a one
specific
product
MODEL
Examples
No input links and no
selector: wrong unit!
p1
EntityB
A.oid
B.oid
EntityB
[Relationship(A2B)]
param1
Input parameter:
value to be used in
the selector: the
matching object is
shown
B.oid
EntityB
[B.attr = param1]
MODEL
IndexUnit
selectedOID
params
Index units:
Entity
[Selector(params)]
Output parameter:
OID of the object selected by the user
12
MODEL
Examples
No input links: all
objects shown
selOID
(B)
EntityB
sourceOID
(A)
selOID
(B)
EntityB
[Relationship(A2B)]
Param1
Input parameter:
value to be compared
with the attribute,
matching objects
shown
selOID
(B)
EntityB
[B.attr = Param1]
RUNNING CASE
Products page
selOID
Product
A simple index is
provided to the
user
Users can access
products by
clicking on index
elements
MODEL
MultiDataUnit
{OIDs}
params
Multidata units
Entity
[Selector(params)]
Output parameter:
13
MODEL
MultiData or Indexes?
Indexes can be used as access mechanism to shown
detailed information about one object
Multidata Units publish information about many objects at
time
MODEL
Entry Unit
params
MODEL
Entry Fields
and Selection Fields
Entry units contains two types of widgets for
data entry:
Fields to insert new value
Selection fields to select a value from a list
14
MODEL
Preloaded Fields
A field can be preloaded with value(s)
Field slots allow the concatenation of multiple values in the
same field
Slots can contain dynamic values taken from the database or
static values defined in the model
FirstName PF.S1
LastName PF.S2
NickName PF.S3
EntryUnit
PersonField
S1
S2
S3
AddrField
Artist
MODEL
Multichoice Unit
{selOIDs}
params
Entity
[Selector(params)]
[Preselector(params)]
Multichoice units:
Publish indexes of elements (SET OF OBJECTS) among which
the user to select one or more elements (with checkboxes)
The container is an Entity (with optional selector & pre-selector)
Input parameters:
Those requested for the computation of the selectors (values for
attribute comparisons and OID of participants to relationships)
Output parameters:
OIDs of the objects checked by the user
Preselector: allows one to define a sub-set of elements as pre-checked
(before any user interaction)
MODEL
Examples
{selOIDs}
Atzeni
(B)
Ceri
Fraternali
Versand
EntityB
sourceOID
(A)
Atzeni {selOIDs}
(B)
Ceri
Fraternali
Versand
EntityB
[PRE:Relationship(A2B)]
sourceOID
(A)
{selOIDs}
Ceri
Fraternali (B)
EntityB
[Relationship(A2B)]
15
MODEL
Hierarchical Unit
{selOIDs}
params
{ Entity
(Relationship)
[Selector]}
Hierarchical units:
Hierarchical Unit
outgoing links
ParamA
ParamB
PEntityA
arB,P
arC
EntityB
EntityA
Category
[selector1]
SubCategory
EntityB
(A2B)
(Cat2SubCat)
[selector2]
Product
EntityC
(B2C)
(SubCat2Prod)
[selector3]
link a
link b
link c
EntityC
Tables link a
Kitchen link b
Korla KJD54
Chairs link a
Stools link b
Roy LKR34
OddVar JSQ87
Office link b
Jess RLT45
MODEL
link c
link c
link c
link c
MODEL
ScrollerUnit
{selOIDs}
params
Entity
[Selector(params)]
Scroller units:
Add browsing capabilities to a set of objects
Publish links to the first, previous, next, last object of the set
Used in conjunction with data, index and multidata units
Number of scrolled objects = block factor
Input: values for attribute comparisons, OID of participants to
a relationship
Output: the set of OIDs (possibly 1) of the current block of
objects
Always placed in the same page as another content unit that
publish the current (block of) object(s)
16
MODEL
Artist
Artist
The entity is the same for the scroller and the data
unit
It is possible to access the data unit also from
another page and the scroller is automatically
syncronized
MODEL
Scroller + index
Paging the result of a search
t,y
Album
[Title contains t]
[Year > y]
Album
MODEL
Pages
A page is a container of one or more pieces of
information shown to the user at the same time
Nesting of pages is allowed: a page can have subpages
The user navigates a site made of pages
Book Index
Login
Catalog
17
MODEL
Book Index
MODEL
Home Page
The Home Page is the main page of a site
It is the first page of the site that the user should
see
Each siteview must contain a page marked as
Home
HomePage
Book Index
MODEL
Landmark pages
Store Page
Books
Books
Store Page
L
Book Details
Authors
Book Details
Authors
18
MODEL
Areas
Area
MODEL
Site Views
A siteview is a set of pages and/or areas forming a
coherent view of the site
Multiple site views can be defined on the same data
model
Different site views can be published for different
types of users and for different types of output
devices
Site views can be
Public: everyone can enter
Private: access control with password protection is enforced
Acme site
view modeling
Two site views on the same data model
Customer: public, for customers
Admin: private, for the administrators and content
managers
19
RUNNING CASE
Product area
L
Home Page
Store Page
H,L
RUNNING CASE
Product area
Combination area
Products
Stores
Combinations
Product
Page
Combination
Detail
BigImages
RUNNING CASE
ACME: HomePage
20
RUNNING CASE
RUNNING CASE
ACME combination
page
21
Model-driven design of
Web applications
3. Content management
and access control
http://www.webratio.com
MODEL
MODEL
Operation Unit
Models a generic external operation, or a built-in
content manipulation operation
Input from one or more incoming links (at least
one is declared as normal link, the others as
transport links)
Two kinds of output links
OK link if the operation completes correctly
KO link if the operation fails
22
MODEL
Built-in Operations
WebML predefines a set of frequently used built-in
operations to manage a sites content
They are the traditional database operations: create,
delete, modify, create relationship, delete
relationship
Users do not need to define the behaviour and the
implementation; they are provided off-the-shelf in
the model
MODEL
Built-in Operations
CREATE
DELETE
MODIFY
Create Unit
Delete Unit
Modify Unit
Entity
Entity
Entity
CONNECT
DISCONNECT
Connect
Unit
Disconnect
Unit
relationship
relationship
MODEL
value1 attribute1
KO
Create Unit
Nothing
OID of
the new object
OK
value2 attribute2
Entity
23
Example
ArtistCreationPage
CreationResultsPage
FName:FirstName
LName: LastName
ArtistEntry
CreateArtist
ArtistDetails
OK
KO
Artist
<FirstName := FName>
<LastName := LName>
Artist
KO
ArtistCreation
CreationResults
CREATE ARTIST
CREATION RESULTS
FirstName: Celine
FirstName: Celine
LastName: Dion
OK
LastName:
Press OK
to create
Dion
OK
MODEL
value1 attribute2
Value2 attribute1
KO
Modify Unit
Identifier(s) of the
modified object(s)
OK
Entity
Example:
ModifyArtist
BioData
KO
Result
ModifyBio
BioData
OK
Artist
BioEntry
Bio: BiographyField
Artist
<BiographicInfo := Bio>
Artist
KO
ModifyArtist
Result
EDIT BIOGRAPHY
ModifyArtist
BIOGRAPHY
Celine Dion
EDIT BIOGRAPHY
Celine Dion
OK
Celine Dion
Bio: Celine Dion was born
in 1968, the youngest of
fourteen children.
OK
24
MODEL
KO
OIDs of the
object(s) to delete
Delete Unit
Entity
Albums
Example:
Nothing
OK
AlbumIndex
DeletionError
DeleteAlbum
NotDeleted
KO
OK
Album
Album
Album
OK
DeletionError
Albums
Albums
NOT DELETED
DELETE ALBUMS
All the way
Anthology
Born in the USA
Bridges to Babylon
Imagine
Let's talk ...
Del
Sing-a-long
DELETE ALBUMS
Let's talk...
1999
1997
Anthology
Bridges to Babylon
Imagine
KO
Sing-a-long
1998
Del
MODEL
OIDs of
source object(s)
to connect
KO
Connect
Unit
OIDs of
destination object(s)
to connect
Identifiers of the
connected objects
OK
relationship
role
MODEL
Example
ReviewPage
Result
Rev : Rev iew.OID
NewReview
ArtistDetails
KO
OK
Rev : OID
AssignReview
Rev iew
Art: Artist.OID
Rev : Rev iew.OID
Art:OID
AllArtists
Artist
[OID = Art]
ReviewDetails
ArtistToRev iew
[Artist.OID = Art ]
[Rev iew.OID = Rev ]
Artist
Rev iew
[OID=Rev ]
KO
NEW REVIEW
One of the most
romantic and
expressive artists
of the nineties.
Result
ARTISTS
Select an artist to
assign the review:
Beatles
* Dion
Prince
OK
ARTIST
REVIEW
First name:
Celine
Last name:
Dion
Review :
One of the m ost
rom antic and
expressive artists
of the nineties.
25
MODEL
Example/2
Artist&AlbumsPage
ArtistDetails
KO
OK
Album
Disconnect
Artist
PublishedAlbums
AlbumDetails
AlbumToArtist
Album
[ArtistToAlbum]
Album
KO
Artist&Albums
Celine Dion
ALBUMS
Artist&Albums
Artist&Albums
Celine Dion
ALBUMS
DETAILS
Sing-a-long
Let's talk...
Let's talk...
Sing-a-long
These are...
* Sing-a-long
These are...
1999
Celine Dion
ALBUMS
OK
Press OK
to remove
OK
Acme administrator
Using global
information
It is often necessary to:
Set a parameter value (e.g. the country or language
preferred by a user)
Use this value globally in all the pages the site view,
without carrying it explicitly along links
Solution
Use global parameters stored in the session
Provide means for setting/getting their value
26
Global Parameters
Global parameters model site-wide information
stored globally or in the user session
A context parameter is defined by:
Name
ID
Duration (User session or Application)
Value type: can be either:
A Printable value (integer, string, )
An Entity (thus, the parameter can assume an OID value
of that entity)
Set unit
Unit that allows to SET the value of a parameter
Value/OID
ParamName
Get unit
Unit that allows to RETRIEVE the value of a
parameter
Value/OID
ParamName
27
Example
GetCountry
SetCountry
NewsPage[L]
CountryData
CurrCountry
CurrCountry
ProductPage [L]
CountrySelectionPage [L]
CountryIndex
CountryData
CountryData
Country
LocalNews
Country
Country
Country
LocalProducts
News
[Country2News]
Product
[Country2Product]
Personalization
Personalization has three facets:
Access control: login/logout operations for user
recognition
MODEL
1:N
1:1
1:N
user2group
1:N
user2defaultGroup
Group
1:1
1:N
SiteView
28
MODEL
Login/ Logout
A site-view may contain a page allowing users to
login
Entry Unit
Login
MODEL
CurrentUser and
CurrentGroup
Each WebML project has two predefined
global parameters:
MODEL
Page personalization
(user-level)
Personalization can be achieved with appropriate
data design
articles
preference
user
CurrentUser
user
article
[preference]
After login
CurrentUser is
identified, thus
the index
shows users
preferred
articles
29
Trolley management
TrolleyPage
GetUser
OK
CurrentUser
CurrentUser
TrolleyData
User
Trolley
[UserToTrolley]
OrderLines
DeleteOrderLine
to Artist Page
Artist:Artist.OID
Album:Album.OID
KO
OrderLine
to Album Page
OrderLine
[TrolleyToOrderLine]
NEST Support
[OrderLineToSupport]
NEST Album
[SupportToAlbum]
NESTArtist
[AlbumToArtist]
References
Building data-intensive Web applications.
By Stefano Ceri, Piero Fraternali, Aldo Bongio, Marco
Brambilla, Sara Comai, Maristella Matera, will be
published by Morgan-Kaufmann (Jim Grays series),
December 2002.
www.webml.org
WebML resources (papers, manuals, )
Web modeling compendium & bibliography
www.webratio.com
Tool can be downloaded for academic use
30