1. WebML
Designing data-, service-
and process-intensive
applications with WebML
Bari, November 24, 2010
Marco Brambilla
Politecnico di Milano and Web Models Srl
http://home.dei.polimi.it/mbrambil
http://twitter.com/MarcoBrambi
http://www.slideshare.net/mbrambil
www.webratio.com
3. WebML
WebML models and concepts
Marco Brambilla
marco.brambilla@polimi.it
marcobrambi
marcobrambi
4. 4
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Advantages of Modeling approach
A rigorous modeling approach:
Can reduce development efforts (cost and time)
Allows a more structured development process
Produces more usable and coherent final results
Design models are self-documenting and always up-to-date
projects
Immediate prototyping can be achieved
5. 5
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Target of WebML
Target: data intensive Web sites
• large amount of data
• interfaces directed to general public
exploratory
browsing-oriented
personalized (1 to 1)
• volatile content, structure, navigation, presentation
WebML is not the right approach for:
• Small Web sites (Homepages, …)
• Static Web sites
6. 6
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
The WebML models
WebML: a conceptual language for high-level design of data-
intensive web sites
Models:
• Content: data organization
• Derivation: redundant data definition
• Composition: definition of site pages as set of subpages and
elementary publishing units
• Navigation: definition of links between pages and between units
• Presentation: positioning of the units in the page and definition of
graphical appearance
11. 11
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Example: derived attributes
Attributes of an entity can be derived by associating to them a
query.
Four types of derived attributes:
• Constant attribute: affiliation: “Politecnico di Milano”
• Imported attributes: maritalName: Self.husband.lastname
• Aggregate attributes: reservation#: count(Self.reservation)
• Calculated attributes: lastPrice: Self.price*discount
The Self keyword identifies the current entity in which the
attribute is defined
16. 16
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
DATAUNIT INDEXUNIT MULTIDATAUNIT
ENTRYUNIT SCROLLERUNIT
Meaning of Content Units
Author
first name:XXX
last name:YYY
photo:
Index of Authors
•S. Ceri
•P. Fraternali
•O.Versand
All Authors
Browse Authors
5/12: go to
1/12
Insert Your Data
•Fname
•Lname
MULTICHOICE
Choose Authors
Ceri
Fraternali
Versand
HIERARCHICAL
Books&Authors
1. Web Applicat.
Ceri
Fraternali
2. Systems
Tannenbaum
18. 18
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Unit input and output
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
unitX
entity
[selector (par 1, .., parN)]
IN OUT
19. 19
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Navigation: contextual links
• A contextual link is an oriented connection between two
units (source unit and target unit), normally rendered by
means of anchors or submit buttons
• Purpose of a contextual link:
•Allowing the user to move from one place to another
•Transporting information from one place to another
•Activating a computation (side effect)
AuthorAuthor
source unit target unit
21. 21
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Automatic Links
•An automatic link passes some default context to the
destination unit immediately after the display of the
source unit, without the user intervention
•Subsequently, the user can change the passed context
by choosing a different object, using the anchor(s)
representing the link
AuthorAuthor
source unit target unitA
26. 26
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Landmark pages
Landmark pages: globally visible pages. The user can jump to them from
everywhere in the site view
It is equivalent to a non contextual link implicitly defined from every other
page in the site view to the landmark page
Authors
Books
L
Book Details
Store Page
Authors
Books
Book Details
Store Page
27. 27
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Areas /Modules
An area/module is a set of logically homogeneous pages
Examples of areas:
• Sections of a portal: Sport, Music, Technology, …
• Elements of a data-management system: Products management, News
management, …
Areas can be nested, so that sub-areas can be defined inside
areas
Each area should have a DEFAULT PAGE or a DEFAULT SUB-
AREA, to give a meaning to landmark areas and non-
contextual links pointing to areas
Area
28. 28
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
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
29. 29
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
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
The predefined WebML units can be enriched by adding
custom external operations (e.g. SendMail, …)
32. 32
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
In/out flow: delete
Nothing
OIDs of the
object(s) to delete
Delete Unit
Entity
KO
OK
OIDs of the object(s) to delete
Albums
DeleteAlbum
Album
DeletionError
OK
KO
NotDeleted
Album
DeletionError
NOT DELETED
All the way
1999
Let's talk...
1997
Sing-a-long
1998
Albums
DELETE ALBUMS
OK
KO
All the way
Born in the USA
Imagine
Let's talk ...
Sing-a-long
Anthology
Bridges to Babylon
Del
AlbumIndex
Album
Albums
DELETE ALBUMS
Imagine
Anthology
Bridges to Babylon
Del
Example:
33. 33
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Example
ReviewPage
° Beatles
* Dion
° Prince
One of the most
romantic and
expressive artists
of the nineties.
Result
First name:
Celine
Last name:
Dion
OK
KO
ARTISTSNEW REVIEW ARTIST
ReviewPage
Rev iew
NewReview
AllArtists
Artist
AssignReview
ArtistToRev iew
[Artist.OID = Art ]
[Rev iew.OID = Rev ]
Rev : OID
Art:OID
Result
Artist
[OID = Art]
ArtistDetails
Art: Artist.OID
OK
Rev : Rev iew.OID
KO
Rev iew
[OID=Rev ]
ReviewDetails
Rev : Rev iew.OID
Select an artist to
assign the review: Review :
One of the most
romantic and
expressive artists
of the nineties.
REVIEW
34. 34
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Context Parameters
WebML Context Parameters allow to achieve this goal in a
simple way
Designer defines one or more Context parameters.
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)
• Starting value [optional]
36. 36
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Get unit
Unit that allows to RETRIEVE the value of a parameter
It is always placed inside a Page
It has only an outgoing link (carrying the value retrieved from
the parameter)
It has not incoming links
The retrieved value can be used in any compatible unit
Value/OID
ParamName
41. 41
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Page personalization (User)
Personalization can be achieved as a result of appropriate
structure design
reservation
userslot
•Hypertext can reflect structure,
and thus provide personalization After login
UserCtxParam
is bound to
“my” identity,
thus the index
shows “my”
reservationsentity:user rel:reservation
Personal Reservations
UserCtxParam
46. 46
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
WebML support for web services
Goal: modeling the interaction between the Web application,
the human users, and the remote systems
New modeling primitives are required:
• primitives for handling the various classes of service operations
Run-time support for Web services
• Ability of exchanging messages
• Integration of application data and Web services XML messages
• Support for conversations
51. 51
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
What is BPM?
Business Process Modeling aims at defining enterprise
businesses in a (semi)formal way
• More to come in future courses
BPMN is flow-chart based notation for defining Business
Processes
The current version is 1.2, with a major revision process for
2.0 in progress
Covers three different levels of process modeling:
• Process Maps – simple flow charts of the activities
• Process Descriptions – flow charts extended with additional
information, but not enough to fully define actual performance
• Process Models – flow charts extended with enough information so
that the process can be analyzed, simulated, and/or executed
52. 52
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Basic concepts
Small set of graphical elements to make it easy for business
users as well as developers to understand the flow and the
process.
Four basic categories of elements compose a business
process diagram (BPD):
• Flow Objects
Events, Activities, Gateways
• Connecting Objects
Sequence Flow, Message Flow, Association
• Swimlanes
Pool, Lane
• Artifacts (Artefacts)
Data Object, Group, Annotation
• It is also allowed to make a custom type of a Flow Object or an Artifact
to make the diagram more understandable.
53. 53
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Pool and lanes
A Pool:
• represents a Participant in the Process. A Participant
can be a specific business entity (e.g., a company) or
can be a more general business role (e.g., a buyer,
seller, or manufacturer)
A Lane:
• Is a sub-partition within a Pool
• Is used to organize and categorize activities within a
Pool.
• Is often used for such things as internal roles (e.g.,
Manager, Associate), systems (e.g., an enterprise
application), an internal department (e.g., shipping,
finance)
55. 55
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
BPMN WebML transformation
Transformation rules
• finer-grained Application Model, needing few refinements by the designer
typed activities enables reusable application models
data dependencies are specified at a higher level
• less errors in Application Model design
• Faster development
55
(1) One control siteview per pool: Human interaction(2) One control serviceview per pool: WS Choreography(3) One site view per lane: user navigation(4) One site view per lane: business logics of activities and gateways(4) One site view per lane: business logics of activities and gateways(5) Orchestration view: a controller component invokes the activities
57. 57
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
The NEXT unit
• The Next unit encapsulates the process control logic
• It exploits the information stored in the Process Metadata
• It calculates the current process status and the enabled state
transitions
• It needs the following input parameters:
– caseID (the currently executed process instance ID)
– activityInstanceID (the current activity instance ID)
– conditionParameters (the values to evaluate the
conditions)
57
NEXT
64. 64
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Automatic Generation of the Appl.
Starting from the models and rules defined in the previous steps,
WebRatio is able to automatically generate the final application. The
result is:
• standard and open Java Web application, no proprietary runtime
• deployable on any Java Application Server
IBM
WebSphere
Caucho
Resin
Apache
Tomcat
Oracle
Application
Server
JBoss
Application
Server
Process layer
Service
layer
Presentation layer
Data
layer
Integration
layer
Standard Java
Web application
Visual identity
Business layer
65. 65
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
When to use WebRatio
1. Business Process Automation “stand-alone”
2. Especially: custom Web application with integrated BPM
describing the core company functions, such as:
• Web Front-End for a legacy information system (ERP)
• Other enterprise IS such as CRM, Ticketing, HR, ...
• Web portal with CMS
• E-Business solutions in B2C or B2B scenarios
65
68. 68
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Acer Euro CMS
B2C + CMS Web applications initially for 14 EU countries
(year 2000)
Corporate news, Product technical & commercial data,
Service & Partner area, Where to Buy…
Multilingual, multi-actor, distributed workflows for local and
central PMs, local and central MarCom managers
... and a: very limited Time to Market (7 weeks!!)
69. 69
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Size & effort
DEGREE OF AUTOMATION
Number of manually written SQL statements 17(SQL constraints)
Percentage of automatically generated SQL code 96%
Number of manually written/adapted Java classes /JSP templates 10% JSP templates
manually adapted
Percentage of automatically generated Java and JSP code 90% JSP templates,
100% Java classes
COST AND ROI
Total cost of software development of first version 75.000 €
HW, SW licenses, and connectivity cost of first version 70.000 € (db server
license)
Return on investment of first version 12-15 months
Average effort of extension to one additional country 0,5 staff-months
Average cost of extension to one additional country 7.500 €
Average ROI of extension to one additional country 2 months
PRODUCTIVITY
Number of function points 177 (B2C web site)
+ 612 (CMS) = 789
Average number of function points delivered per staff-month 131,5
70. 70
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Critical Considerations (continued)
On the negative side..
• Acer estimates that it took from 4 to 6 months to have fully
productive developers with MDD, WebML, and WebRatio.
..but..
• The initial investment in human capital required by MDD pays off in
the mid term
MDD benefits testing, maintenance, and evolution (which account for
over 60% of the total lifecycle cost)
reasoning on the system is far more effective at the conceptual level
Served Contries and Applications
4 4 4 5 5
17
24
32
41
56
17
21
24
28
31
0
10
20
30
40
50
60
2001 2002 2003 2004 2005
Year
Units
Number of developers
Number of
maintained
applications
Number of served
countries
71. 71
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Major European bank – large BPM case
The pilot application for the first country (planned to be
extended to 10 more) covers
• 52 business processes
• 1,100 activities
• 30 user roles.
• Application load of 300 registered users, with 100,000 cases / 2 MLN
activities per month
The development team comprised
• 14 staff members from three organizations
• total effort amounting to 2551 man days, spent in 375 elapsed days
72. 72
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
Major European bank – large BPM case
Distribution of effort:
• 12% for business process analysis and re-engineering,
• 6% for BP modeling according to BPMN,
• 12% for wrapping existing legacy procedures as services accessible
through SOA and BP orchestration,
• 5% for designing the support interfaces for the BPM
• 55% for the design and refinement of the application models that
implement the logic of the activities
• 10% for the design of collateral application for increasing usability and
employee productivity (data look-ups, etc).
Central role played by the detailed application design
Main benefits were
• Rapid prototyping, thanks to which 4 major prototypes and 35 minor releases
• Support of teamwork, which allowed 14 contributors from 3 different
organization to work together
73. 73
marco.brambilla@polimi.it
http://home.dei.polimi.it/mbrambil
WebML
References and useful links
WebML Site (http://www.webml.org)
Audio lessons
Teaching materials (slides)
Solved exercises and examples
Research papers
WebRatio Site (http://www.webratio.com)
Download of the tool
WebRatio GoogleGroup (https://groups.google.com/group/webratio)
WebRatio Official Wiki (http://wiki.webratio.com)
Getting started
Specific technical articles
• BPMN Official Site (http://www.bpmn.org/)
• My research blog (http://marcobrambi.blogspot.com)