How I learned to stop worrying and love the data model Doug Tidwell Strategist, IBM Software Group [email protected]
Jan 13, 2015
How I learned to stop worrying and love the data model
Doug TidwellStrategist, IBM Software Group
Objectives
Introduce XForms, an open standard for business forms
Illustrate how to generate applications and data models from business process models
Show how everything can be generated from the business process model
XForms
The next generation of forms on the Web
XForms
A W3C effort to “bring HTML forms into the 20th century”
Forms should be integrated with data models
One form should be renderable on many types of devices
Use a declarative model as much as possible
HTML forms - weaknesses
Based solely on appearanceReliance on scriptingNon-Western character support is
spottyCross-device forms are very difficult to
writeNo real data model
Advantages of XForms
XForms has an underlying data model that can be generated from your existing business objects.
XForms has an underlying data model that can be generated from your existing business objects.
XForms has an underlying data model that can be generated from your existing business objects.
Advantages of XForms
Choose a winner: <xf:select1 ref="/bracket/results/result[1]/@winnerSeed"> <xf:label>Round 1, Matchup 1</xf:label> <xf:item> <xf:label> <xf:output value="/bracket/…"/> </xf:label> <xf:value>1</xf:value> </xf:item> <xf:item> <xf:label> <xf:output value="/bracket/…"/>. . .
Advantages of XForms
With XForms, we’re specifying what the data is.
The XPath expression says we’re choosing a value for the winnerSeed attribute on the first <result> element in the <results> element in the <bracket> element.
The label for the selection and the labels for each item are extracted from the XML document.
Advantages of XForms
We don’t say how the data is displayed. We can define rules elsewhere to say how
this is rendered based on the number of choices, type of device, whatever.
A brief tour of XForms
We’ll look at the different kinds of controls you can use.
We’ll focus on the dynamic nature of XForms, and show how to use plug-ins and Ajax to run the forms on the client.
A wee demo
Free XForms tools
alphaWorks Visual XForms Designer
An Eclipse-based tool for building XForms
Free XForms tools
alphaWorks XForms Generator
Converts XML documents and schemas to XForms
Building and deploying XForms
Building and deploying
One of the challenges of deploying XForms is getting XForms support on the client.
We’ll look at two approaches: Requiring a browser plug-in Using Ajax controls
Using a browser plug-in
Typically useful in an intranet For Internet Explorer, there’s MozzIE,
written by Peter Nunnsourceforge.net/projects/mozzie
Mozilla has an XForms plug-in; it’s available at https://addons.mozilla.org/ en-US/firefox/addon/824
Using Ajax controls
The Chiba project provides an open-source XForms engine.
It uses XSLT to transform the XForms document into Ajax-enabled HTML pages and send them to the client.
Chiba doesn’t require any client-side plug-ins.
Using Ajax controls
We’ll look at the Orbeon Presentation Server, an open-source XForms engine.
It uses the XForms definition to generate Ajax-enabled HTML pages and send them to the client.
Orbeon doesn’t require any client-side plug-ins.
It’s based on Chiba.
XForms at the W3C
XForms Version 1.1 is currently in Last Call at the W3C.
IBM’s John Boyer is the editor of the spec.
IBM’s Jan Kratky is behind the alphaWorks XForms tools. He’s also a member of the XForms working group.
The importance of data models
Data models
Lost in all the excitement of Web 2.0 is the fact that our spiffy interfaces have to do something useful.
You can build Web pages with JavaScript libraries to put a happy face on a business process
Are these maintainable? Probably not. We want these pages to be tied to our data
model.
Our data models
Code from data models
We can generate Java beans and database schemas directly from our data model.
We’ll take a quick look at the data model behind our application.
A Web 2.0 UI
The application
The application
What we’ll generate
An XForms data model, generated directly from our XML schema.
We now have a modern front end to our application.
Achtung!
At a test run of this session, several people lost consciousness in the excitement of the demo.
If you are prone to hyperventilation, motion sickness or Tourette’s syndrome, we implore you to avert your eyes during this portion of the program.
Unfortunately, we cannot be responsible for your medical expenses.
Majestic demo
A glimpse at the future
The technologies developed by the Open Service Oriented Architecture group (osoa.org) make your SOA simpler and easier to manage:
Service Component Architecture (SCA): Gives you a single API for packaging, using and assembling components
Service Data Objects (SDO): Gives you a single API for accessing data sources
OSOA.org
A group of 17 companies taking SOA interoperability to the next level:
A glimpse at the future
If you’re using these technologies, or would like to know more about them, please contact me…[email protected]
Resources
Resources
IBM developerWorks: ibm.com/developerworks/xml
Steven Pemberton’s XForms presentation on the W3C site:
w3.org/2007/Talks/05-15-steven-xforms11/
The XForms spec: w3.org/TR/2007/WD-xforms11-20070222/ [Last call draft]
Resources
FormFaces: formfaces.com
Chiba: See chiba.sourceforge.net
Orbeon Presentation Server: Available at orbeon.com, open-sourced
under the GPL
Resources
MozzIE: sourceforge.net/projects/mozzie Uses the Mozilla Gecko rendering engine
Firefox XForms add-on: Select ToolsAdd-ons, then click Get
Extensions, search for “XForms” https://addons.mozilla.org/ en-US/firefox/addon/824
Resources
Visual XForms Designer: ibm.com/alphaworks/tech/vxd
XML Forms Generator: ibm.com/alphaworks/tech/xfg
Open Service-Oriented Architecture group: osoa.org
Summary
Summary
We’ve covered several important topics: XForms, an open standard for forms Generating data models and applications
from business process models Generating Rich Internet Applications from
data models Keeping the back-end and the front-end of
an application synchronized