thickbugSoftware and s/w Development

Oct 28, 2013 (4 years and 7 months ago)



XML Lessons learned

David Orchard

Technical Architect

Pacific Development Centre


Pacific Development Centre

New Lab in Vancouver Canada

Solutions/FOAK assets

Education, Government, Sports, Telecom, Banking

Technical architect on:

IBM Student Server

University student self
service web Asset

Access to all silo
based functions

registration, tuition, admission, grades, …

Prototype May 98

Ver 1.0 Asset shipped Oct 98

Ver 2.0 Live at University of Minnesota

One of first IBM web sites/app using XML

Some modest Requirements

PeopleSoft Student Admin 7.0

Running on Sun E10000 box


has >5000 tables

Access by PS GUI and our app

Integrate with University’s X.500


100 concurrent threads/requests

hundreds of requests/second.

Peak registration week has 60 registrations/minute

Updates through Win32 based api

registration actually done by 30 second COBOL job!

Reads through ODBC

Solution architecture

Web App front end on IBM 3 node 16 cpu SP2

IBM WebSphere 2.0 Standard

WebSphere performance pack for load

24 Windows NT boxes for PS API

Connect via RMI

Developed using Visual Age, FrontPage

IBM Java 1.6 VM, XML4J Parser

Design Decisions

Decided on XML in Nov 97

EJB Style persistence

No Containers or transactions

Servlets then JSPs

PS & DB Connector

based UI

Declarative/XML usages:

1. Runtime generation of HTML from Java (XML)

2. Compile
time generation of Java (XML)

3. Runtime specification of Java Objects and
Templates (.SHTML)

Rejected as transfer over HTTP between nodes

RMI used

Note: All 3 forms use Java at run

NO run
time XML

Runtime Java


Java object

Wrote Java code to convert Java to XML using DOM

Thrown out due to XSL tech + performance difficulties

Via HTML Template

IBM internal template programming language (TPL)

Applies XML template to Java Object

Produces any textual output

Java object + XML
based HTML template

Note: Java Server Pages (JSP) can do first 2

JSP not available at the time ( Last year )

I still like TPL better

Note 2: JSP/XSL different architectures

IBM Template Processing Language


The business object description is:

<scope PROPERTY="career">

The career code is: $code$


<repeat PROPERTYARRAY="terms">









ish object defn. (YAEJBML)

Data Object definition, EJB Template (XML)

TPL based

Generates Home, Key, Interface, Data Object,
Business Object

ish beans don’t have containers or

YAEJBML sample

<?xml version="1.0"?>

<!DOCTYPE DOlist SYSTEM "../../DTD/DO.dtd">


<DO name="StudentEnrollment"


<property name="emplid" key="true"/>

<property name="classNumber" key="true"/>

<property name="enrollStatus" />



XML Views

Used Lazy initialization of relationships

Performance was awful!

Created SQL Views with matching XML Views

Binds SQL Views to YAEJBML elements

New findBy method on Home

follows view specification

Some restrictions:

Result Set Columns must be grouped by Bean

No circular references

Declarative Non
XML usage

Created Web Object Builder (WOB)

Parameters to WOB Servlet

Business Object, Keys, FindBy Method, Template

<SERVLET NAME="WebObjectBuilder"







Declarative mechanism for:

BO Home.findByMethod(Keys from POST or
session data )

Lock web session

set web session on BO

execute method specified or commit()

render according to template

get web session data from BO

put into web session

unlock web session

Declarative everywhere:

PeopleSoft or RDB binding to Java class (DO) in

Views binding in XML

Template for Java object to HTML in XML

Originally XSL then IBM template tool

HTML/JSP page specifying Java Object and
Template to render

VIP: Everything can be declarative

Assumes no behavior in Java Object

But: can add behavior betwixt presentation and DO

+ve Design lessons

Declarative means reuse at design/compile time!

View optimizer would have been much harder if EJB

Declarative means easily regenerate code

Not as many options for tracing/logging/debugging

Much easier to create hundreds of DOs than VAJ

Complete control over behavior and interface

Declarative means easy to adapt

IMHO, adaptability is a crucial success factor

refactoring classes meant text search and replace

GUI developers didn’t need VAJ

Declarative means easy to author

Data Objects, Object templates, Web templates

ve Lessons Learned


XML will replace Java programming

XML always means presentation independence

Java + DOM are sufficient/”perfect together”

XSL is easy and will become ubiquitous

Model Data correctly for interchange

Observations about XML and Transforms

Myth: Procedures in XML

Tried in 2 places

HTML Template

DO templates

End up creating declarative constructs for:

parameters, data types, expressions, loop constructs,
variable scoping, subclassing/extension

Can became convoluted

TPL, XSL suffers from this

Can’t author/debug like Java

Suggestion: Declarative for pattern matching


Better Java text templating would have solved problem

Myth: Presentation Independence

Soo many RFPs with the XML+XSL to any client

Especially XML to IVR + Palmtop + browser + other

Works in many cases, usually document

Similar styles of documentation

print + web pages

Rebranding of content

stories to branded web sites

Interactive web sites are a different story

Many issues from XML to client:

Navigation, Input Data validation, Output Formatting,
Amount/ordering of content, Scrolling in content

Process becomes multi

Dispatcher queries for content, then format

Suggestion: XML best chance at re

Myth: Java/XML “perfect together”

Common B2B, B2C Use Case:

Take lots of EJBs and convert to XML

Condition: read
only classes and DTDs


Write procedural code using DOM to serialize

Use reflection
based Conversion

Usually use DOM

Poor performance in current implementations

Transfer strongly typed XML tree to Java tree

ie public class student
> <student></student>

XML/Java issues


Java has, XML doesn’t

Contain/embed/link to the parent?

Implements, extends?


Java has handles, XML has Linkss


Java primitives to strings and back

in types + Java classes

Array/Vector/List/Hashtable become ??

String value become attribute or entity

XML Pis and Comments

Java/XML ideas

Serialization Proposal:

XML binding for Java<

NOT the focus of the Sun Java/XML data binding JSR

Compile XSLT to Java for performance

Perl/SAX pattern/entity matching in Java

Interface between XSLT and Java

call XSLT from JSP

call Java from XSLT

BUT: still problems of type conversion

Java based template string and streams

MessageFormat is awful, poor child of sprintf

generalization of JSP

Perl, others have

IMHO, only “perfect” because java xml parsers

Myth: XSLT solves presentation

XSLT is declarative programming language

XSL has all the constructs of a programming language

Procedures, parameters, variables, VM (DOM)

Difficult to author and debug

ie, creating a Form with CSS, JavaScript, nested tables

Course list table with radio buttons select course and
required subcomponents

XSLT needs usability performance/scalability

Serialize Java tree into DOM tree currently

Solution: Know when to use XSL vs JSP

Myth: Model Data “Correctly”

Same “Universal Model” myth heard with rdb
and Java

Same modeling problems exist in XML

Example: When is a person a student?

Finance dept: When fees charged

Registrar:Accepted to University

Department: Enrolled in any course

Instructor: Enrolled in course with grade

Student society: Paid student fee

Do you create a student entity?

Solution: Don’t be deluded into “correct” model


XML everywhere means transforms are key

Need to chain multiple transforms together

Different sources/sinks of transform data

Transforms are behavior

Death of O

Where does Java fit?

Watch for much confusion in market on

JSP+ EJB on DB versus XSLT+XML on DB

XML Schema Announcement

Preview of new XML4J functionality

binary only, 90 day license, to be updated frequently

feedback to XML4J@us.ibm.com

Supports subset of 6 May 1999 Schema Working

subset corresponds to DTD functionality


track the whole Schema spec

read and validate documents using either DTDs or

convert DTDs to schemas and schemas to DTDs

access to DTD and Schema via a DOM extension


XML widely usable for defining Data

Debatable use for defining behavior/procedures

Combined with code generation

Adaptable software

Easy to author

End2End functionality without Java

Can be part of

large performance & scalability

Student Server

Proven Universal Data Language

Needs work, watch out for hype

tooling, maturity, Java integration

Pretty Good for a toddler!