Upload
marco-brambilla
View
2.140
Download
0
Embed Size (px)
DESCRIPTION
Seminar given at Politecnico di Bari, November 2010
Citation preview
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
[email protected]://home.dei.polimi.it/mbrambil
WebML
Agenda
WebML models and concepts Advanced topics: Web services, BPM, Ajax WebRatio 6 BPM Industrial cases
[email protected]://home.dei.polimi.it/mbrambil
WebML
Advantages of Modeling approachA 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
projectsImmediate prototyping can be achieved
[email protected]://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
[email protected]://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
[email protected]://home.dei.polimi.it/mbrambil
WebML
Preview of WebML concepts Site = Content + Composition + Navigation + Presentation
contentnavigation +composition
presentationuser models
entities,relationships
units, pages,links
site views styles
[email protected]://home.dei.polimi.it/mbrambil
WebML
Development process
Business Requirements
HYPERTEXT DESIGN
DATA DESIGN
ARCHITECTURE DESIGN
REQUIREMENTS SPECIFICATION
IMPLEMENTATIONTESTING & EVALUATION
MAINTAINANCE & EVOLUTION
[email protected]://home.dei.polimi.it/mbrambil
WebML
Data Model Simplified Entity-Relationship model
• Binary relationships between entities• IS-A hierarchies• Simple typed
attributes in entities• Derivation model
can be applied forredundant data
Book
Author Genre
BestSeller
[email protected]://home.dei.polimi.it/mbrambil
WebML
WebML OCL Derivation consist of writing expressions called “derivation
queries” Queries can be expressed using WebML OCL Derivable concepts:
• Entities, relationships, attributes Derivation queries can be automatically transformed into SQl
views installed in the database
[email protected]://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
[email protected]://home.dei.polimi.it/mbrambil
WebML
Hypertext Model
• Q1: what information is published in the hypertext nodes? • Q2: how are the hypertext nodes connected?• Q3: how is the hypertext divided into pages served to the user?
• A1: content units (Composition)• A2: links (Navigation)• A3: pages (Composition)
[email protected]://home.dei.polimi.it/mbrambil
WebML
Composition: examples of Content UnitsDATAUNIT
INDEXUNIT
content
content
To publish information about A SINGLE object(e.g. AuthorDetail)
To publish a list of objects (e.g. IndexOfAuthors)
[email protected]://home.dei.polimi.it/mbrambil
WebML
Composition: examples of Unit rendering
DATAUNIT
INDEXUNIT
Author first name:XXX last name:YYY photo:
Index of Authors
• S. Ceri• P. Fraternali• O.Versand
Author
Author
[email protected]://home.dei.polimi.it/mbrambil
WebML
DATAUNIT INDEXUNIT MULTIDATAUNIT
ENTRYUNIT SCROLLERUNIT
entity[Selector]
Content:• instances of
an entity
Basic Content Units
entity[Selector]
entity[Selector]
entity[Selector]
MULTICHOICE
entity[Selector]
Selector:• set of
conditions
HIERARCHICAL
entity[Selector]
[email protected]://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 Fraternali2. Systems Tannenbaum
[email protected]://home.dei.polimi.it/mbrambil
WebML
Content Units A WebML unit is the atomic information publishing element
It is a “view” defined upon a container of objects:• All the instances of an entity• Instances of an Entity that meet a selection condition called selector
unitX
container
[email protected]://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
[email protected]://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
[email protected]://home.dei.polimi.it/mbrambil
WebML
Author first name:James last name:Joyce photo:
Author[OID=p1]
Book[author2book(p2)]
Book[OID=p3]
Book Title:Ulysses Price:23$ Cover:
Which author’s books? Which book?
Books of YYY
• Ulysses• The Dubliners• Portrait...
Example of links
p1 p2 p3
[email protected]://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
[email protected]://home.dei.polimi.it/mbrambil
WebML
Transport Links
AuthorBook[Author2Book]
• A transport link has a default context that is passed to the target unit immediately after the display of the source unit, without the user intervention
• The user cannot change the default context and therefore the link is not rendered with an anchor
source unit target unit
[email protected]://home.dei.polimi.it/mbrambil
WebML
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 sub-pages The user navigates a site made of pages
LoginBook Index Catalog
[email protected]://home.dei.polimi.it/mbrambil
WebML
Non contextual links A non contextual link is a link between pages No context (information) is transported
The user can browse from a page to another one via an anchor (e.g., >>Books)
HomePage Book Index
[email protected]://home.dei.polimi.it/mbrambil
WebML
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 H Book Index
[email protected]://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
[email protected]://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
[email protected]://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
[email protected]://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, …)
[email protected]://home.dei.polimi.it/mbrambil
WebML
Built-in Operations
Delete Unit
Entity
Create Unit
Entity
Modify Unit
Entity
CREATE DELETE MODIFY
Disconnect Unit
relationship
Connect Unit
relationship
CONNECT DISCONNECT
[email protected]://home.dei.polimi.it/mbrambil
WebML
In/out flows
Create Unit
Entity
value1 attribute1
value2 attribute2
OID of the new object
KO
OK
Nothing
Value2 attribute1 value1 attribute2
Identifier(s) of the modified object(s)
Modify Unit
Entity
KO
OK
Identifier(s) of the object(s) to modify
OIDs of objects to modify
[email protected]://home.dei.polimi.it/mbrambil
WebML
In/out flow: delete
NothingOIDs 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 way1999
Let's talk...1997
Sing-a-long
1998
Albums
DELETE ALBUMS
OK
KO
All the way
Born in the USA
ImagineLet's talk ...Sing-a-long
Anthology
Bridges to Babylon
Del
AlbumIndex
Album
Albums
DELETE ALBUMS
Imagine
AnthologyBridges to Babylon
Del
Example:
[email protected]://home.dei.polimi.it/mbrambil
WebML
Example
Rev iewPage
° Beatles
* Dion
° Prince
One of the mostromantic andexpressive artistsof the nineties.
Result
First name:CelineLast 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.OIDKO
Rev iew[OID=Rev ]
ReviewDetails
Rev : Rev iew.OID
Select an artist toassign the review: Review :
One of the mostromantic andexpressive artistsof the nineties.
REVIEW
[email protected]://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]
[email protected]://home.dei.polimi.it/mbrambil
WebML
Set unit Unit that allows to SET the value of a parameter
It is always placed outside a Page It has only an incoming link (carrying the value to be assigned
to the parameter) It has not outgoing links
Value/OID
ParamName
[email protected]://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
[email protected]://home.dei.polimi.it/mbrambil
WebML
Example
NewsPage[L]
CountrySelectionPage [L]
CountryIndex
Country Country
CountryData
LocalNews
News[Country2News]
SetCountry
CurrCountry
Country
CountryData
GetCountry
CurrCountry
ProductPage [L]
Country
CountryData
LocalProducts
Product[Country2Product]
[email protected]://home.dei.polimi.it/mbrambil
WebML
Personalization Personalization has three facets:
• Access control: login/logout operations for user recognition
• Site view assignement: based on the group a user belong, some site views are accessible (1 or more site view per Group)
• Page personalization: user or group dependent content
[email protected]://home.dei.polimi.it/mbrambil
WebML
User / Group model Each User can belong to one or more Groups (predefined
entities in the structural model) Each user has one default Group Each group has one associated Siteview
User Group1:N 1:N
1:1 1:N
Module1:N1:1
user2group
user2defaultGroup
[email protected]://home.dei.polimi.it/mbrambil
WebML
Login/ Logout A site-view may contain a page allowing users to login
Each secured site-view should allow users to logout
Dynamic Role Changing (i.e. group) allowed
Entry Unit Login
Logout
ChangeGroup
[email protected]://home.dei.polimi.it/mbrambil
WebML
Page personalization (User) Personalization can be achieved as a result of appropriate
structure design
reservationuserslot
• 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
[email protected]://home.dei.polimi.it/mbrambil
WebML
Presentation Presentation dealt with along two lines:
• Gallery of default presentation styles applicable to site views or single
pages (with elementary unit positioning on a grid) each presentation style is an XSL stylesheet
• Compatibility with best selling tools for presentation editing, for advanced page design
[email protected]://home.dei.polimi.it/mbrambil
WebML
1.2.e Style guidelines specificationPage grid:
Content positioning:Content positioning:Graphical guidelines:
[email protected]://home.dei.polimi.it/mbrambil
WebML
Web services architecture
Service Integration
Service Discovery
Service Publication
Service Description
XML - based Messaging
Transport
BPEL4WS IBM, Microsoft & BEAWCSI SunBPML BPMI.org WSFL IBMXLANG Microsoft
UDDI UDDI.org
UDDI UDDI.org
WSDL W3C
SOAP W3CXML W3C
HTTP W3C
[email protected]://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
[email protected]://home.dei.polimi.it/mbrambil
WebML
Actual implementation within the tool
Web Service invocations
Web service publishing
[email protected]://home.dei.polimi.it/mbrambil
WebML
DEMO: the mediator at work Receive PO
Obtain CustomerId
Create Order
Send Lines
Close Order
[email protected]://home.dei.polimi.it/mbrambil
WebML
Model-driven Development Process Manual specification of (extended) BPMN process model Automatic transformation of BPMN to WebML Possible manual refinement of WebML models Automatic running code generation on J2EE platform
50
[email protected]://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
[email protected]://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.
[email protected]://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)
Pool
Lane
1La
ne 2
[email protected]://home.dei.polimi.it/mbrambil
WebML
Sequence flow A Sequence Flow is used to show the order that activities will
be performed in a Process The source and target must be one of the following objects:
• Events
• Activities
• Gateways
A Sequence Flow cannot cross a Sub-Process boundary or a Pool boundary
Task 1
Task 2Task 1
[email protected]://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
[email protected]://home.dei.polimi.it/mbrambil
WebML
ProcessMetadata
Run-Time
Log
Actors
Data Model
[email protected]://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
[email protected]://home.dei.polimi.it/mbrambil
WebML
Conceptual modeling of AJAX features WebML currently covers a limited set of AJAX features
• Major revision foreseen Partial page refresh Popup windows
[email protected]://home.dei.polimi.it/mbrambil
WebML
Conceptual modeling of AJAX features Dynamic tooltips
Drag and drop
[email protected]://home.dei.polimi.it/mbrambil
WebML
WebRatio 6 BPM WebRatio 6 BPM permits you to:
• Model and Document your processes• Execute and Validate your processes by instantly prototyping• Developing, Improving and Refining your processes and create a
complete Web application
[email protected]://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
IBMWebSphere
Caucho Resin
ApacheTomcat
OracleApplication
Server
JBossApplication
Server
Process layer
Servicelayer
Presentation layer
Datalayer
Integrationlayer
Standard JavaWeb application
Visual identity
Business layer
[email protected]://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
[email protected]://home.dei.polimi.it/mbrambil
WebML
WebRatio functionalities Content model design Business proces model design Data derivation (Derivation Wizard) Hypertext model design (siteviews) Consistency checks (warnings) Mapping onto a datasource Units positioning in the pages Automatic web site generation Integration of advanced features (BPM, Web services, AJAX)
WebML
Industrial cases
Marco Brambilla
Politecnico di Milano and Web Models Srl
[email protected]://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!!)
[email protected]://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
[email protected]://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
1724
32
41
56
1721 24
28 31
0
10
20
30
40
50
60
2001 2002 2003 2004 2005
Year
Un
its
Number of developers
Number ofmaintainedapplications
Number of servedcountries
[email protected]://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
[email protected]://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
[email protected]://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)
[email protected]://home.dei.polimi.it/mbrambil
WebML
Thanks
http://home.dei.polimi.it/mbrambil http://twitter.com/MarcoBrambi
http://www.slideshare.net/mbrambil
For comments or questions:Marco BrambillaPolitecnico di MilanoDipartimento di Elettronica e [email protected]