SlideShare uma empresa Scribd logo
1 de 41
Baixar para ler offline
XML and Java:
Lessons Learned in Building
       Applications

        Rachel Reinitz
Websphere and VisualAge Services
          Ted Leung
  XML4J Parser Technical Lead
Agenda
Technology background

  XML

  Java

Architectures

Guidelines

XML Tools

Summary
Distributed OO Middleware

   Java                                           XML
Portable Programs                            Portable Data




                      Open
                    Standards




              Distributed Object Infrastructure

                    CORBA
                                                             IP Network
                                     Pervasive Networks      IP Network
XML - eXtensible Markup Language

XML was derived from SGML
  80% of function, 20% of complexity

XML is key for e-business
  standard way to share structured data

XML and Java work well together
  Java = portable code
  XML = portable data

XML says nothing about presentation
XML example - Address Book

Address Book Markup Language sample

<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>

<!DOCTYPE addressBook SYSTEM quot;abml.dtdquot;>

<addressBook>
  <person salary=quot;26350.00quot; band=quot;Dquot;>
    <name>
      <family>Wallace</family> <given>Bob</given>
    </name>
    <email>bwallace@megacorp.com</email>
  </person>
</addressBook>
Document Type Description
DTD Example for Address Book
<?xml encoding=quot;UTF-8quot;?>
<!ELEMENT addressBook (person)+>
<!ELEMENT person (name,email*)>

<!ATTLIST person salary CDATA #REQUIRED >
<!ATTLIST person band (A|B|C|D|E|F) #REQUIRED >
<!ATTLIST person active (true|false) quot;truequot;
#IMPLIED >

<!ELEMENT   name (family, given)>
<!ELEMENT   family (#PCDATA)>
<!ELEMENT   given (#PCDATA)>
<!ELEMENT   email (#PCDATA)>
A Sampling of DTDs
                            Bean Markup Language (BML)
Open Financial Exchange
(OFX)                       Translation Memory eXchange
                            (TMX)
Online Trading Protocol
(OTP)                       Mathematical Markup Language
                            (MathML)
Information and Content
Exchange (ICE)              Scalable Vector Graphics (SVG)
XML Bookmark Exchange       Astronomical Markup
Language (XBEL)             Language (AML)
Channel Definition Format   Biopolymer Markup Language
(CDF)                       (BIOML)
XML Remote Procedure Call   Common Business Library
(XML-RPC)                   (CBL)
Wireless Markup Language    Extensible Logfile Format (XLF)
(WML)                       Genealogical Data in XML
Resource Description        (GedML)
Framework (RDF)             Human Resources Markup
Precision Graphics Markup   Language (HRML)
Language (PGML)             and many, many more....
XML Parsers

What does a parser do?
  Provides an API for a program to access pieces of an XML
  document

What API does a parser expose?
  DOM = Document Object Model
    quot;DOM treequot; = tree structure containing XML information,
    accessible by the DOM API
  memory intensive

SAX = Simple API for XML
  used for processing streams of XML information (without
  building a DOM tree)
  event driven, and typically non-validating
XSLT / XSL
XSL = XML Style Language

XSL is an XML to XML transformation system
  There are two parts
  XSLT is the tree transformation part of the language
  Formatting Objects

The transformation is declaratively specified in XML

A big use of XSL is to convert XML to HTML
  this is where browser support comes into play (?)

Still in working draft stage
  Being combined with XPointer
XSLT Example
<?xml version=quot;1.0quot; encoding=quot;US-ASCIIquot;?>
<xsl:stylesheet xmlns:xsl=quot;http://www.w3.org/XSL/Transform/1.0quot;>
<xsl:template match=quot;personquot;>
  <html><body>
   <xsl:apply-templates/>
  </body></html>
</xsl:template>
<xsl:template match=quot;namequot;> <!-- reverse given & family name -->
  <xsl:value-of select='given'/>
  <xsl:text> </xsl:text>
  <xsl:value-of select='family'/>
</xsl:template>
<xsl:template match=quot;emailquot;>
  <a>
   <xsl:attribute name=quot;hrefquot;> <!-- add an href attribute -->
      <xsl:text>mailto:</xsl:text>
      <xsl:apply-templates/>
    </xsl:attribute>
   <xsl:apply-templates/>
  </a>
</xsl:template>
</xsl:stylesheet>
XSLT Result


<html>
  <body>
    Bob Wallace
    <a href=quot;mailto:bwallace@megacorp.comquot;>
     bwallace@megacorp.com
    </a>
  </body>
</html>
XML Schema

A richer language for constraining XML content

Syntax is regular XML syntax, not DTD syntax

Support for data typing, inheritance

Still in Working Draft form
XML Schema Example
<?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?>
<!DOCTYPE schema PUBLIC quot;-//W3C/DTD XML Schema Version 1.0//ENquot;
quot;http://www.w3.org/1999/05/06-xmlschema-1/structures.dtdquot;>
<schema>
  <elementType name=quot;addressBookquot;>
    <elementTypeRef name=quot;personquot; minOccur=quot;1quot;></elementTypeRef></elementType>
  <elementType name=quot;personquot;>
    <sequence occurs=quot;1quot;>
      <elementTypeRef name=quot;namequot; minOccur=quot;1quot; maxOccur=quot;1quot;></elementTypeRef>
      <elementTypeRef name=quot;emailquot; minOccur=quot;0quot;></elementTypeRef></sequence>
    <attrDecl name=quot;bandquot; required=quot;truequot;>
      <datatypeRef name=quot;NMTOKENquot;>
        <enumeration>
          <literal>A</literal>
          <literal>B</literal>
          <literal>C</literal></enumeration></datatypeRef></attrDecl>
    <attrDecl name=quot;activequot;>
      <datatypeRef name=quot;NMTOKENquot;>
        <enumeration>
          <literal>true</literal>
          <literal>false</literal></enumeration>
        <default>true</default></datatypeRef></attrDecl></elementType>
  <elementType name=quot;namequot;>
     <sequence occurs=quot;1quot;>
      <elementTypeRef name=quot;familyquot; minOccur=quot;1quot; maxOccur=quot;1quot;></elementTypeRef>
      <elementTypeRef name=quot;givenquot; minOccur=quot;1quot;
                maxOccur=quot;1quot;></elementTypeRef></sequence></elementType>
   </elementType></schema>
Must I use Java to use XML?

NO!!!

While many of the best programming tools for XML are
currently Java-based, XML is completely language
neutral

XML is about system-to-system interaction and
component-to-component collaboration, regardless of the
underlying programming technology
Key Java Technologies
Java Virtual Machine (JVM)

Applets - Java code downloaded into a browser

JavaBeans - Java's component model

Servlets - Java on the server - similar to CGI

Java Server Pages (JSP)- HTML and Java in one file on
the server for dynamic content

Enterprise Java Beans (EJB) - distributed, server
component model

Java Naming and Directory Services (JNDI)
Servlets
Servlet is a Java class that can be used to dynamically extend your
server's function. Servlets, as defined by Sun, are:



          quot;... objects which conform to a specific interface
         that can be plugged into a Java-based server.
         Servlets are similar to applets in that they are object
         byte codes that can be dynamically loaded off the
         net....
         They serve as platform independent, dynamically
         loadable, plugable helper byte-code objects on the
         server side....quot;



In short, a servlet is to the server what the applet is to the client
browser.

Servlets have a standard interface, which is defined in the package
javax.servlet.
What XML and Java are Not

A silver bullet
  still have to design, code, and test

Guaranteed communication
  agreement between vendors and users is still required

Not an Object-Oriented Modeling Language
  use UML/XMI for that

Not middleware
  used to develop robust middleware

A replacement for HTML
XML and Java
XML - Servlets
  great way to start on xml server applications
  (e.g. xml enabler)

XML - JSPs
  a different model to XSL for transformations

XML - EJBs: for more complex applications,
  particularly transactional

XML is the technology that ties together EJBs, Message
Broker and Web Serving.
  XML supports message formatting and transformation
  EJBs provide the model for stateful business logic and
  business process logic within business workflow
Java + XML - The Winning Team

                                               Application
 Client               Gateway                                            Resource Managers
                                                Server
                                                                                         DB2
                                                                                       EJBs and
                                                                                     stored procs.
                            Servlet                 Enterprise
  Applet
                          JavaBeans                                    gs
                                                    JavaBeans
JavaBeans
                                                                   L ms               XML & SQL
                                                                 XM                   stored data
                                      XML msgs
            XML msgs                                               via IIOP or
                                                                   MQ or IPC
                                      via IIOP or
            via HTTP or
                                                                    XM
                                                                      Lm
                                      MQ or IPC
            IIOP or MQ
                                                                                      CICS
                                                                        sgs
                                                                                    EJBs and
Standard                                                                            CICS trans.
Browser
                                                                                    XML & VSAM




                                                                         XM
XML
                                                                                    stored data




                                                                           Lm
Enabled
Browser




                                                                             sg
                                                                               s
                                                                                      Domino
                                                                                     EJBs and
                                                                                    Java agents
Applications = Programs +                                                           XML & forms
                                                                                    stored data
Data
Architectures using Servlets and
                 XML

We will discuss about some architectures which combine
use of servlet and XML.

The application server which the servlet interacts with could
be an EJB server; a database with or without Java stored
procedures; MQSeries; CICS;etc.

We will present design considerations based on work we
have done with customers when designing servlets and
XML.
  special focus on supporting business objects
HTML/XML/DB Architecture
               HTML -> servlet -> XML -> Query (SQL) -> DB
               HTML <- XSL <- XML <- JDBC result set <- DB
                                                                                                        RDB
                                                  Java Application Server
    Browser
                                                                                                        Server
                                                 WebServer + Servlet Engine
Displays initial
                     servlet




                                                            transform HTML
HTML page




                                                                                XML converted
                                                                                into SQL query
                                                                                JDBC is called
                     calls




                                                           input into XML
                                      Servlets
                     using
HTML form
                     HTTP
action
calls a servlet
                                                                                                 JDBC
 <FORM METHOD=
 POST ACTION=
 quot;/servlet/GetDataServletquot;>                                XML4J Parser
                                          HTML generator




 HTML page             HTML
                                                                             converted into
 showing the
                                                                             JDBC results
 results of the
                                          using XSL




 query
                                                                             XML


                               XSL
                               file
An Example Application Problem
Client Requirements
  support an applet client for Intranet users
  support a thin HTML client for Internet users
  support interfaces to third-party applications

Complex business logic
  business objects to be used on server and in applet

Security
  authentication and single logon
  SSL encryption

Scalability using multiple servers and tiers

Server to access data in a relational database
  Note: other types of backends could be use instead of RDB
Applet to Java Server using RMI
                    (no XML)
                                         Applet <-> RMI <-> servlet
      Client Browser                                                     Java Application Server                                          RDB
       Java Applet                                                           (no webserver)                                               Server


                                          Java




                                                                                                  Infrastructure to DB - creates
                                          Remote




                                                       RMI skeletons and RMI
                                          Method
                                          Invocation




                                                                               Business Objects
        Business Objects




                                          over                                                                                     JDBC
                                          sockets




                                                                                                  the busines objects
GUI




                           RMI stubs




                                                       Objects
                                         Java
                                         serialized
                                         objects
                                         are sent



                                         RMI calls
                                       Third-party applications
                                  RMI Skeletons and RMI Objects
Applet to Servlet Architecture
                                                           using XML
                        applet <-> bus objects <-> XML <-> servlet <-> bus objects
                         Client Browser                                                   Java Application Server                                        RDB
                          Java Applet                                                    WebServer + Servlet Engine                                      Server
                                                                       servlet
                           toXML                                                               toXML
                                                                       calls
                                                                       using




                                                                                                                 Infrastructure to DB - creates
                                                                       HTTP
Java GUI (AWT, Swing)




                                                                       passing




                                                                                              Business Objects
                                                                       XML
                           Business Objects




                                                                                                                                                  JDBC
                                                     Servlet Callers




                                                                                                                 the busines objects
                                                                                   Servlets


                                                                       XML
                                                                       returned



                                                                                  Customized
                                              Customized
                                                                                  XML 4Java
                                              XML 4Java
                                                                                  Parser using
                                              Parser using
                                                                                  SAX API
                                              SAX API
Third-party to Servlet Architecture
                 using XML
 Third-party application <-> XML <-> servlet <-> bus objects
  Third-Party                      Java Application Server                                             RDB
  Application                     WebServer + Servlet Engine                                           Server
                  servlet
                                          toXML
                  calls




                                                               Infrastructure to DB - creates
Application in    using
                  HTTP
any language
                  passing
                  XML




                                            Business Objects
                                                                                                JDBC
XML parser to




                                                               the busines objects
                               Servlets
xxx language
servlet callers
                  XML
      or          returned

 into a RDB

     or                      Customized
                             XML 4Java
transformed to
                             Parser using
 HTML                        SAX API
Potential Benefits using XML and
           Servlets Together
Leverage webserver technology for provide security
   single logon
   servlet security
   SSL is very simple
Highly scaleable using webserver and load balancing
technology
Integration into a large website is simplified
Provide distinct, flexible interface the application servers
   between application components
   for 3rd party
Support multiple front-ends
   transform results from XML to HTML using XSL
   3rd applications written in any language can call the servlets
   and receive XML
   queuing of messages is easily supported
   XML rendered directly in the browser
Design Choices - XML
Non-technical considerations
  cooperation in industry (suppliers, consumers)
  competitive advantage
  dominant players may dictate
When to use DTD validation
  better performance without validation
  turn off when system is closed, turn on for third-party use
XML type definition is limited to Strings
  modeling work is required to map objects or tables
Consider XML namespace issues
To transform business objects to XML requires custom
code
Storing XML into a RDB
  map from flat text structure to relational tables
  map from business object to relational tables
  store XML into text extenders
  more direct support for XML is coming
Design Choices - DOM vs SAX
     wrt XML <-> Busines Objects
 Both DOM and SAX being widely supported and standardized

       DOM                              SAX
                               API oriented mechanism
Creates a Document
                               which is triggered by XML
Object Model tree.
                               tags
DOM tree which must be
                               Calls handler when XML
reparsed and converted
                               tag is read
into business objects.
DOM tree is not really         Generates events without
used.                          the DOM tree
Need to subclass               Code is straightforward
business objects from
DOM superclass
Subclassing DOM parser
is more complex code.
Design Choices - DTD Specification
Designed to support generalization
Simple instance data represented as attributes instead of
sub-elements
 performance tradeoff vs richness of information
Inheritance
 XML's flat structure does not provide any inherent support for inheritance
 superclass attributes included in the DTD for every concrete subclass
Relationships represented as generalized 'Association
elements'
  <!ELEMENT Association EMPTY >
     <!ATTLIST Association
         name            CDATA #REQUIRED
         multiplicity    (1..1|1..n|n..m) #REQUIRED
         oids           CDATA #REQUIRED
     >
 No contained objects are defined in the DTD
 Linked to lazy initialization of relationships
 Look to modeling community for guidance
Design Choices - Servlets
Calls to servlets serve as API calls into the Java Server
  'command' and parameters can be included as a parameter
  of the servlet
    ex. VehicleServlet?command=retrieve&oid=1234567
    basic validation of commands
  represent the APIs in the XML which is passed to the servlet
Servlet design
  Single command processor servlet
  Seperate servlet for each set of related commands such as
  CRUD for a business object
  Seperate servlet for each command
Handle required parameter information versus optional
information
  API should be 'forgiving'
    i.e. able to handle unexpected information and lack of optional
    information
Guidelines for Development
                Process
Get help/input from business people
Model the business objects and DTD separately
  want your DTD to be application independent
  DTD should be designed independently of a data or object
  model
    but with consideration of the databases and applications to be
    supported
    i.e. start from a purist view and compromise
  map between the business objects, database, and XML as
  needed
Validate DTD with business people and third-parties
  keep it simple where possible
prototype, prototype, prototype
  measure performance
search for existing solutions and tools
  XML and Java tool space moves quickly
XML Architectures
        (future is coming quickly)
XML directly in and out of DB2
  HTML -> servlet -> XML -> DB2
  DB2 -> XML -> XSL processing servlet -> HTML

XML transformed by MQ

XML directly rendered in a browser
  using XSL

XML used with MQ Integrator to communicate between
business or systems

XML with Java Messaging Service (JMS)

XML provides configuration information for systems
XML Tools

Changing drastically / quickly
Standards are moving quickly, tools keeping up
Java is preferred development language
  Unicode
Tool Categories
  XML Parsers
  Database support
  Messaging product support
  XML Editors
  XSL Processors
  Java class libraries
    digital signature
    visual beans
IBM XML Tools

Available from Alphaworks (www.alphaworks.ibm.com)
  XML Parser for Java (XML4J)
  Lotus XSL
  XML Productivity Kit for Java
  XML Security Suite
  Xeena
  Bean Markup Language
  P3P
  XML Diff and Merge, XML TreeDiff
  XML Parser for C++
WebSphere
MQ Series
DB2 6.1
DB2 XML and Text Extenders
                                    DB2
                                    Table
                                            CLOB
         XML
         Doc



     FileSystem


           XML
           Doc




                        Data Link



Store an XML document in DB2 as column or collection of fields
Store XML document in an external file - Data Links Manager

New structured XML search with DB2 text extender
   searches XML stored in column
   enables searches to be narrowed more meaningfully
     by structure as well as content
XML and MQSeries

MQSeries Integrator
  Bridging XML and legacy messages
  XML is the preferred message format
    Dictionary support for messages
    Routing and processing based on message content
  XML used internally
    Configuration management
    Links between tools and runtime

MQSeries Family
  Consolidation using XML
    Common set of GUI tools
    Published interfaces
alphaWorks XML Technologies...

XML Parser for Java (XML4J) - the core component for
XML solutions, and its companion XML Productivity Kit
DataCraft for creating and publishing XML views of
databases
LotusXSL processor to construct HTML for viewing by a
web browser from an XML document
TexML - this processor allows you to produce typeset
output from XML
P3P Parser - an XML solution which implements Platform
for Privacy Preferences (P3P)
RDF for XML - Resource Description Framework
processor written in Java for building, querying, and
manipulating RDF database structures.
alphaWorks XML Technologies...

Dynamic XML for automating Java interpretation of XML
PatML for converting XML documents to other languages
XML TreeDiff used to identify and update DOM trees just
like data files
XML BeanMaker to generate Java bean classes from an
XML DTD
TaskGuide Viewer - an XML-based tool for creating
wizards.
Bean Markup Language (BML) for configuring Java
components
XML EditorMaker for building XML visual editors
XML Enabler for viewing XML in various browsers via
servlet
External IBM XML Website



                          fo
                        in
                      L
                    XM
                 of
              ce
            ur
          so
       st
     be
  ur
Yo
DEMO
References
Useful Sites

  www.ibm.com/xml

  www.ibm.com/java

  www.alphaworks.ibm.com

  www.finetuning.com

  www.xml.com

  www.xml.org

  www.sun.com/java

Mais conteúdo relacionado

Mais procurados

Introduction to JSP
Introduction to JSPIntroduction to JSP
Introduction to JSP
Fulvio Corno
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
Daniel Egan
 

Mais procurados (19)

Presenter manual RIA technology (specially for summer interns)
Presenter manual RIA technology (specially for summer interns)Presenter manual RIA technology (specially for summer interns)
Presenter manual RIA technology (specially for summer interns)
 
Xml applications
Xml applicationsXml applications
Xml applications
 
XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)
XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)
XML and XML Applications - Lecture 04 - Web Information Systems (WE-DINF-11912)
 
Model-Driven Software Development - Strategies for Design & Implementation of...
Model-Driven Software Development - Strategies for Design & Implementation of...Model-Driven Software Development - Strategies for Design & Implementation of...
Model-Driven Software Development - Strategies for Design & Implementation of...
 
Xmll
XmllXmll
Xmll
 
XML parsing using jaxb
XML parsing using jaxbXML parsing using jaxb
XML parsing using jaxb
 
XML | Computer Science
XML | Computer ScienceXML | Computer Science
XML | Computer Science
 
AvocadoDB query language (DRAFT!)
AvocadoDB query language (DRAFT!)AvocadoDB query language (DRAFT!)
AvocadoDB query language (DRAFT!)
 
Introduction to JSP
Introduction to JSPIntroduction to JSP
Introduction to JSP
 
Linq To The Enterprise
Linq To The EnterpriseLinq To The Enterprise
Linq To The Enterprise
 
Card12
Card12Card12
Card12
 
Unit 5-jdbc2
Unit 5-jdbc2Unit 5-jdbc2
Unit 5-jdbc2
 
Transformation of Java Server Pages: A Modern Approach
Transformation of Java Server Pages: A Modern ApproachTransformation of Java Server Pages: A Modern Approach
Transformation of Java Server Pages: A Modern Approach
 
Data Binding Unleashed for Composite Applications
Data Binding Unleashed for Composite ApplicationsData Binding Unleashed for Composite Applications
Data Binding Unleashed for Composite Applications
 
Xml 1
Xml 1Xml 1
Xml 1
 
JSR-222 Java Architecture for XML Binding
JSR-222 Java Architecture for XML BindingJSR-222 Java Architecture for XML Binding
JSR-222 Java Architecture for XML Binding
 
Xml tutorial
Xml tutorialXml tutorial
Xml tutorial
 
Roma introduction and concepts
Roma introduction and conceptsRoma introduction and concepts
Roma introduction and concepts
 
Advanced Excel
Advanced Excel Advanced Excel
Advanced Excel
 

Semelhante a IBM Solutions '99 XML and Java: Lessons Learned

OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
Marco Gralike
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
chomas kandar
 
Xml Java
Xml JavaXml Java
Xml Java
cbee48
 
Ram Kumar - Sr. Certified Mule ESB Integration Developer
Ram Kumar - Sr. Certified Mule ESB Integration DeveloperRam Kumar - Sr. Certified Mule ESB Integration Developer
Ram Kumar - Sr. Certified Mule ESB Integration Developer
Ram Kumar
 

Semelhante a IBM Solutions '99 XML and Java: Lessons Learned (20)

XML, XML Databases and MPEG-7
XML, XML Databases and MPEG-7XML, XML Databases and MPEG-7
XML, XML Databases and MPEG-7
 
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
Real World Experience With Oracle Xml Database 11g An Oracle Ace’s Perspectiv...
 
Semantic RDF based integration framework for heterogeneous XML data sources
Semantic RDF based integration framework for heterogeneous XML data sourcesSemantic RDF based integration framework for heterogeneous XML data sources
Semantic RDF based integration framework for heterogeneous XML data sources
 
8023.ppt
8023.ppt8023.ppt
8023.ppt
 
RESTful Services
RESTful ServicesRESTful Services
RESTful Services
 
J2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for womenJ2EE PPT --CINTHIYA.M Krishnammal college for women
J2EE PPT --CINTHIYA.M Krishnammal college for women
 
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
OPP2010 (Brussels) - Programming with XML in PL/SQL - Part 1
 
Unit 10: XML and Beyond (Sematic Web, Web Services, ...)
Unit 10: XML and Beyond (Sematic Web, Web Services, ...)Unit 10: XML and Beyond (Sematic Web, Web Services, ...)
Unit 10: XML and Beyond (Sematic Web, Web Services, ...)
 
Dev381.Pp
Dev381.PpDev381.Pp
Dev381.Pp
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
Document Object Model
Document Object ModelDocument Object Model
Document Object Model
 
JavaServer Pages
JavaServer PagesJavaServer Pages
JavaServer Pages
 
Processing XML with Java
Processing XML with JavaProcessing XML with Java
Processing XML with Java
 
Xml Java
Xml JavaXml Java
Xml Java
 
Expertezed 2012 Webcast - XML DB Use Cases
Expertezed 2012 Webcast - XML DB Use CasesExpertezed 2012 Webcast - XML DB Use Cases
Expertezed 2012 Webcast - XML DB Use Cases
 
Jstl &amp; El
Jstl &amp; ElJstl &amp; El
Jstl &amp; El
 
OpenESB
OpenESBOpenESB
OpenESB
 
[DSBW Spring 2010] Unit 10: XML and Web And beyond
[DSBW Spring 2010] Unit 10: XML and Web And beyond[DSBW Spring 2010] Unit 10: XML and Web And beyond
[DSBW Spring 2010] Unit 10: XML and Web And beyond
 
Ram Kumar - Sr. Certified Mule ESB Integration Developer
Ram Kumar - Sr. Certified Mule ESB Integration DeveloperRam Kumar - Sr. Certified Mule ESB Integration Developer
Ram Kumar - Sr. Certified Mule ESB Integration Developer
 
UNIT-1 Web services
UNIT-1 Web servicesUNIT-1 Web services
UNIT-1 Web services
 

Mais de Ted Leung

MySQL User Conference 2009: Python and MySQL
MySQL User Conference 2009: Python and MySQLMySQL User Conference 2009: Python and MySQL
MySQL User Conference 2009: Python and MySQL
Ted Leung
 
Northwest Python Day 2009
Northwest Python Day 2009Northwest Python Day 2009
Northwest Python Day 2009
Ted Leung
 
PyCon UK 2008: Challenges for Dynamic Languages
PyCon UK 2008: Challenges for Dynamic LanguagesPyCon UK 2008: Challenges for Dynamic Languages
PyCon UK 2008: Challenges for Dynamic Languages
Ted Leung
 
OSCON 2008: Open Source Community Antipatterns
OSCON 2008: Open Source Community AntipatternsOSCON 2008: Open Source Community Antipatterns
OSCON 2008: Open Source Community Antipatterns
Ted Leung
 
OSCON 2007: Open Design, Not By Committee
OSCON 2007: Open Design, Not By CommitteeOSCON 2007: Open Design, Not By Committee
OSCON 2007: Open Design, Not By Committee
Ted Leung
 
Ignite The Web 2007
Ignite The Web 2007Ignite The Web 2007
Ignite The Web 2007
Ted Leung
 
ApacheCon US 2007: Open Source Community Antipatterns
ApacheCon US 2007:  Open Source Community AntipatternsApacheCon US 2007:  Open Source Community Antipatterns
ApacheCon US 2007: Open Source Community Antipatterns
Ted Leung
 
OSCON 2005: Build Your Own Chandler Parcel
OSCON 2005: Build Your Own Chandler ParcelOSCON 2005: Build Your Own Chandler Parcel
OSCON 2005: Build Your Own Chandler Parcel
Ted Leung
 
PyCon 2005 PyBlosxom
PyCon 2005 PyBlosxomPyCon 2005 PyBlosxom
PyCon 2005 PyBlosxom
Ted Leung
 
SeaJUG March 2004 - Groovy
SeaJUG March 2004 - GroovySeaJUG March 2004 - Groovy
SeaJUG March 2004 - Groovy
Ted Leung
 
OSCON 2004: XML and Apache
OSCON 2004: XML and ApacheOSCON 2004: XML and Apache
OSCON 2004: XML and Apache
Ted Leung
 
OSCON 2004: A Developer's Tour of Chandler
OSCON 2004: A Developer's Tour of ChandlerOSCON 2004: A Developer's Tour of Chandler
OSCON 2004: A Developer's Tour of Chandler
Ted Leung
 
SeaJUG Dec 2001: Aspect-Oriented Programming with AspectJ
SeaJUG Dec 2001: Aspect-Oriented Programming with AspectJSeaJUG Dec 2001: Aspect-Oriented Programming with AspectJ
SeaJUG Dec 2001: Aspect-Oriented Programming with AspectJ
Ted Leung
 
IQPC Canada XML 2001: How to develop Syntax and XML Schema
IQPC Canada XML 2001: How to develop Syntax and XML SchemaIQPC Canada XML 2001: How to develop Syntax and XML Schema
IQPC Canada XML 2001: How to develop Syntax and XML Schema
Ted Leung
 
IQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic Communication
IQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic CommunicationIQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic Communication
IQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic Communication
Ted Leung
 

Mais de Ted Leung (20)

DjangoCon 2009 Keynote
DjangoCon 2009 KeynoteDjangoCon 2009 Keynote
DjangoCon 2009 Keynote
 
A Survey of Concurrency Constructs
A Survey of Concurrency ConstructsA Survey of Concurrency Constructs
A Survey of Concurrency Constructs
 
Seeding The Cloud
Seeding The CloudSeeding The Cloud
Seeding The Cloud
 
Programming Languages For The Cloud
Programming Languages For The CloudProgramming Languages For The Cloud
Programming Languages For The Cloud
 
MySQL User Conference 2009: Python and MySQL
MySQL User Conference 2009: Python and MySQLMySQL User Conference 2009: Python and MySQL
MySQL User Conference 2009: Python and MySQL
 
PyCon US 2009: Challenges and Opportunities for Python
PyCon US 2009: Challenges and Opportunities for PythonPyCon US 2009: Challenges and Opportunities for Python
PyCon US 2009: Challenges and Opportunities for Python
 
Northwest Python Day 2009
Northwest Python Day 2009Northwest Python Day 2009
Northwest Python Day 2009
 
PyCon UK 2008: Challenges for Dynamic Languages
PyCon UK 2008: Challenges for Dynamic LanguagesPyCon UK 2008: Challenges for Dynamic Languages
PyCon UK 2008: Challenges for Dynamic Languages
 
OSCON 2008: Open Source Community Antipatterns
OSCON 2008: Open Source Community AntipatternsOSCON 2008: Open Source Community Antipatterns
OSCON 2008: Open Source Community Antipatterns
 
OSCON 2007: Open Design, Not By Committee
OSCON 2007: Open Design, Not By CommitteeOSCON 2007: Open Design, Not By Committee
OSCON 2007: Open Design, Not By Committee
 
Ignite The Web 2007
Ignite The Web 2007Ignite The Web 2007
Ignite The Web 2007
 
ApacheCon US 2007: Open Source Community Antipatterns
ApacheCon US 2007:  Open Source Community AntipatternsApacheCon US 2007:  Open Source Community Antipatterns
ApacheCon US 2007: Open Source Community Antipatterns
 
OSCON 2005: Build Your Own Chandler Parcel
OSCON 2005: Build Your Own Chandler ParcelOSCON 2005: Build Your Own Chandler Parcel
OSCON 2005: Build Your Own Chandler Parcel
 
PyCon 2005 PyBlosxom
PyCon 2005 PyBlosxomPyCon 2005 PyBlosxom
PyCon 2005 PyBlosxom
 
SeaJUG March 2004 - Groovy
SeaJUG March 2004 - GroovySeaJUG March 2004 - Groovy
SeaJUG March 2004 - Groovy
 
OSCON 2004: XML and Apache
OSCON 2004: XML and ApacheOSCON 2004: XML and Apache
OSCON 2004: XML and Apache
 
OSCON 2004: A Developer's Tour of Chandler
OSCON 2004: A Developer's Tour of ChandlerOSCON 2004: A Developer's Tour of Chandler
OSCON 2004: A Developer's Tour of Chandler
 
SeaJUG Dec 2001: Aspect-Oriented Programming with AspectJ
SeaJUG Dec 2001: Aspect-Oriented Programming with AspectJSeaJUG Dec 2001: Aspect-Oriented Programming with AspectJ
SeaJUG Dec 2001: Aspect-Oriented Programming with AspectJ
 
IQPC Canada XML 2001: How to develop Syntax and XML Schema
IQPC Canada XML 2001: How to develop Syntax and XML SchemaIQPC Canada XML 2001: How to develop Syntax and XML Schema
IQPC Canada XML 2001: How to develop Syntax and XML Schema
 
IQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic Communication
IQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic CommunicationIQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic Communication
IQPC Canada XML 2001: How to Use XML Parsing to Enhance Electronic Communication
 

Último

Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 

Último (20)

Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

IBM Solutions '99 XML and Java: Lessons Learned

  • 1. XML and Java: Lessons Learned in Building Applications Rachel Reinitz Websphere and VisualAge Services Ted Leung XML4J Parser Technical Lead
  • 2. Agenda Technology background XML Java Architectures Guidelines XML Tools Summary
  • 3. Distributed OO Middleware Java XML Portable Programs Portable Data Open Standards Distributed Object Infrastructure CORBA IP Network Pervasive Networks IP Network
  • 4. XML - eXtensible Markup Language XML was derived from SGML 80% of function, 20% of complexity XML is key for e-business standard way to share structured data XML and Java work well together Java = portable code XML = portable data XML says nothing about presentation
  • 5. XML example - Address Book Address Book Markup Language sample <?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?> <!DOCTYPE addressBook SYSTEM quot;abml.dtdquot;> <addressBook> <person salary=quot;26350.00quot; band=quot;Dquot;> <name> <family>Wallace</family> <given>Bob</given> </name> <email>bwallace@megacorp.com</email> </person> </addressBook>
  • 6. Document Type Description DTD Example for Address Book <?xml encoding=quot;UTF-8quot;?> <!ELEMENT addressBook (person)+> <!ELEMENT person (name,email*)> <!ATTLIST person salary CDATA #REQUIRED > <!ATTLIST person band (A|B|C|D|E|F) #REQUIRED > <!ATTLIST person active (true|false) quot;truequot; #IMPLIED > <!ELEMENT name (family, given)> <!ELEMENT family (#PCDATA)> <!ELEMENT given (#PCDATA)> <!ELEMENT email (#PCDATA)>
  • 7. A Sampling of DTDs Bean Markup Language (BML) Open Financial Exchange (OFX) Translation Memory eXchange (TMX) Online Trading Protocol (OTP) Mathematical Markup Language (MathML) Information and Content Exchange (ICE) Scalable Vector Graphics (SVG) XML Bookmark Exchange Astronomical Markup Language (XBEL) Language (AML) Channel Definition Format Biopolymer Markup Language (CDF) (BIOML) XML Remote Procedure Call Common Business Library (XML-RPC) (CBL) Wireless Markup Language Extensible Logfile Format (XLF) (WML) Genealogical Data in XML Resource Description (GedML) Framework (RDF) Human Resources Markup Precision Graphics Markup Language (HRML) Language (PGML) and many, many more....
  • 8. XML Parsers What does a parser do? Provides an API for a program to access pieces of an XML document What API does a parser expose? DOM = Document Object Model quot;DOM treequot; = tree structure containing XML information, accessible by the DOM API memory intensive SAX = Simple API for XML used for processing streams of XML information (without building a DOM tree) event driven, and typically non-validating
  • 9. XSLT / XSL XSL = XML Style Language XSL is an XML to XML transformation system There are two parts XSLT is the tree transformation part of the language Formatting Objects The transformation is declaratively specified in XML A big use of XSL is to convert XML to HTML this is where browser support comes into play (?) Still in working draft stage Being combined with XPointer
  • 10. XSLT Example <?xml version=quot;1.0quot; encoding=quot;US-ASCIIquot;?> <xsl:stylesheet xmlns:xsl=quot;http://www.w3.org/XSL/Transform/1.0quot;> <xsl:template match=quot;personquot;> <html><body> <xsl:apply-templates/> </body></html> </xsl:template> <xsl:template match=quot;namequot;> <!-- reverse given & family name --> <xsl:value-of select='given'/> <xsl:text> </xsl:text> <xsl:value-of select='family'/> </xsl:template> <xsl:template match=quot;emailquot;> <a> <xsl:attribute name=quot;hrefquot;> <!-- add an href attribute --> <xsl:text>mailto:</xsl:text> <xsl:apply-templates/> </xsl:attribute> <xsl:apply-templates/> </a> </xsl:template> </xsl:stylesheet>
  • 11. XSLT Result <html> <body> Bob Wallace <a href=quot;mailto:bwallace@megacorp.comquot;> bwallace@megacorp.com </a> </body> </html>
  • 12. XML Schema A richer language for constraining XML content Syntax is regular XML syntax, not DTD syntax Support for data typing, inheritance Still in Working Draft form
  • 13. XML Schema Example <?xml version=quot;1.0quot; encoding=quot;UTF-8quot;?> <!DOCTYPE schema PUBLIC quot;-//W3C/DTD XML Schema Version 1.0//ENquot; quot;http://www.w3.org/1999/05/06-xmlschema-1/structures.dtdquot;> <schema> <elementType name=quot;addressBookquot;> <elementTypeRef name=quot;personquot; minOccur=quot;1quot;></elementTypeRef></elementType> <elementType name=quot;personquot;> <sequence occurs=quot;1quot;> <elementTypeRef name=quot;namequot; minOccur=quot;1quot; maxOccur=quot;1quot;></elementTypeRef> <elementTypeRef name=quot;emailquot; minOccur=quot;0quot;></elementTypeRef></sequence> <attrDecl name=quot;bandquot; required=quot;truequot;> <datatypeRef name=quot;NMTOKENquot;> <enumeration> <literal>A</literal> <literal>B</literal> <literal>C</literal></enumeration></datatypeRef></attrDecl> <attrDecl name=quot;activequot;> <datatypeRef name=quot;NMTOKENquot;> <enumeration> <literal>true</literal> <literal>false</literal></enumeration> <default>true</default></datatypeRef></attrDecl></elementType> <elementType name=quot;namequot;> <sequence occurs=quot;1quot;> <elementTypeRef name=quot;familyquot; minOccur=quot;1quot; maxOccur=quot;1quot;></elementTypeRef> <elementTypeRef name=quot;givenquot; minOccur=quot;1quot; maxOccur=quot;1quot;></elementTypeRef></sequence></elementType> </elementType></schema>
  • 14. Must I use Java to use XML? NO!!! While many of the best programming tools for XML are currently Java-based, XML is completely language neutral XML is about system-to-system interaction and component-to-component collaboration, regardless of the underlying programming technology
  • 15. Key Java Technologies Java Virtual Machine (JVM) Applets - Java code downloaded into a browser JavaBeans - Java's component model Servlets - Java on the server - similar to CGI Java Server Pages (JSP)- HTML and Java in one file on the server for dynamic content Enterprise Java Beans (EJB) - distributed, server component model Java Naming and Directory Services (JNDI)
  • 16. Servlets Servlet is a Java class that can be used to dynamically extend your server's function. Servlets, as defined by Sun, are: quot;... objects which conform to a specific interface that can be plugged into a Java-based server. Servlets are similar to applets in that they are object byte codes that can be dynamically loaded off the net.... They serve as platform independent, dynamically loadable, plugable helper byte-code objects on the server side....quot; In short, a servlet is to the server what the applet is to the client browser. Servlets have a standard interface, which is defined in the package javax.servlet.
  • 17. What XML and Java are Not A silver bullet still have to design, code, and test Guaranteed communication agreement between vendors and users is still required Not an Object-Oriented Modeling Language use UML/XMI for that Not middleware used to develop robust middleware A replacement for HTML
  • 18. XML and Java XML - Servlets great way to start on xml server applications (e.g. xml enabler) XML - JSPs a different model to XSL for transformations XML - EJBs: for more complex applications, particularly transactional XML is the technology that ties together EJBs, Message Broker and Web Serving. XML supports message formatting and transformation EJBs provide the model for stateful business logic and business process logic within business workflow
  • 19. Java + XML - The Winning Team Application Client Gateway Resource Managers Server DB2 EJBs and stored procs. Servlet Enterprise Applet JavaBeans gs JavaBeans JavaBeans L ms XML & SQL XM stored data XML msgs XML msgs via IIOP or MQ or IPC via IIOP or via HTTP or XM Lm MQ or IPC IIOP or MQ CICS sgs EJBs and Standard CICS trans. Browser XML & VSAM XM XML stored data Lm Enabled Browser sg s Domino EJBs and Java agents Applications = Programs + XML & forms stored data Data
  • 20. Architectures using Servlets and XML We will discuss about some architectures which combine use of servlet and XML. The application server which the servlet interacts with could be an EJB server; a database with or without Java stored procedures; MQSeries; CICS;etc. We will present design considerations based on work we have done with customers when designing servlets and XML. special focus on supporting business objects
  • 21. HTML/XML/DB Architecture HTML -> servlet -> XML -> Query (SQL) -> DB HTML <- XSL <- XML <- JDBC result set <- DB RDB Java Application Server Browser Server WebServer + Servlet Engine Displays initial servlet transform HTML HTML page XML converted into SQL query JDBC is called calls input into XML Servlets using HTML form HTTP action calls a servlet JDBC <FORM METHOD= POST ACTION= quot;/servlet/GetDataServletquot;> XML4J Parser HTML generator HTML page HTML converted into showing the JDBC results results of the using XSL query XML XSL file
  • 22. An Example Application Problem Client Requirements support an applet client for Intranet users support a thin HTML client for Internet users support interfaces to third-party applications Complex business logic business objects to be used on server and in applet Security authentication and single logon SSL encryption Scalability using multiple servers and tiers Server to access data in a relational database Note: other types of backends could be use instead of RDB
  • 23. Applet to Java Server using RMI (no XML) Applet <-> RMI <-> servlet Client Browser Java Application Server RDB Java Applet (no webserver) Server Java Infrastructure to DB - creates Remote RMI skeletons and RMI Method Invocation Business Objects Business Objects over JDBC sockets the busines objects GUI RMI stubs Objects Java serialized objects are sent RMI calls Third-party applications RMI Skeletons and RMI Objects
  • 24. Applet to Servlet Architecture using XML applet <-> bus objects <-> XML <-> servlet <-> bus objects Client Browser Java Application Server RDB Java Applet WebServer + Servlet Engine Server servlet toXML toXML calls using Infrastructure to DB - creates HTTP Java GUI (AWT, Swing) passing Business Objects XML Business Objects JDBC Servlet Callers the busines objects Servlets XML returned Customized Customized XML 4Java XML 4Java Parser using Parser using SAX API SAX API
  • 25. Third-party to Servlet Architecture using XML Third-party application <-> XML <-> servlet <-> bus objects Third-Party Java Application Server RDB Application WebServer + Servlet Engine Server servlet toXML calls Infrastructure to DB - creates Application in using HTTP any language passing XML Business Objects JDBC XML parser to the busines objects Servlets xxx language servlet callers XML or returned into a RDB or Customized XML 4Java transformed to Parser using HTML SAX API
  • 26. Potential Benefits using XML and Servlets Together Leverage webserver technology for provide security single logon servlet security SSL is very simple Highly scaleable using webserver and load balancing technology Integration into a large website is simplified Provide distinct, flexible interface the application servers between application components for 3rd party Support multiple front-ends transform results from XML to HTML using XSL 3rd applications written in any language can call the servlets and receive XML queuing of messages is easily supported XML rendered directly in the browser
  • 27. Design Choices - XML Non-technical considerations cooperation in industry (suppliers, consumers) competitive advantage dominant players may dictate When to use DTD validation better performance without validation turn off when system is closed, turn on for third-party use XML type definition is limited to Strings modeling work is required to map objects or tables Consider XML namespace issues To transform business objects to XML requires custom code Storing XML into a RDB map from flat text structure to relational tables map from business object to relational tables store XML into text extenders more direct support for XML is coming
  • 28. Design Choices - DOM vs SAX wrt XML <-> Busines Objects Both DOM and SAX being widely supported and standardized DOM SAX API oriented mechanism Creates a Document which is triggered by XML Object Model tree. tags DOM tree which must be Calls handler when XML reparsed and converted tag is read into business objects. DOM tree is not really Generates events without used. the DOM tree Need to subclass Code is straightforward business objects from DOM superclass Subclassing DOM parser is more complex code.
  • 29. Design Choices - DTD Specification Designed to support generalization Simple instance data represented as attributes instead of sub-elements performance tradeoff vs richness of information Inheritance XML's flat structure does not provide any inherent support for inheritance superclass attributes included in the DTD for every concrete subclass Relationships represented as generalized 'Association elements' <!ELEMENT Association EMPTY > <!ATTLIST Association name CDATA #REQUIRED multiplicity (1..1|1..n|n..m) #REQUIRED oids CDATA #REQUIRED > No contained objects are defined in the DTD Linked to lazy initialization of relationships Look to modeling community for guidance
  • 30. Design Choices - Servlets Calls to servlets serve as API calls into the Java Server 'command' and parameters can be included as a parameter of the servlet ex. VehicleServlet?command=retrieve&oid=1234567 basic validation of commands represent the APIs in the XML which is passed to the servlet Servlet design Single command processor servlet Seperate servlet for each set of related commands such as CRUD for a business object Seperate servlet for each command Handle required parameter information versus optional information API should be 'forgiving' i.e. able to handle unexpected information and lack of optional information
  • 31. Guidelines for Development Process Get help/input from business people Model the business objects and DTD separately want your DTD to be application independent DTD should be designed independently of a data or object model but with consideration of the databases and applications to be supported i.e. start from a purist view and compromise map between the business objects, database, and XML as needed Validate DTD with business people and third-parties keep it simple where possible prototype, prototype, prototype measure performance search for existing solutions and tools XML and Java tool space moves quickly
  • 32. XML Architectures (future is coming quickly) XML directly in and out of DB2 HTML -> servlet -> XML -> DB2 DB2 -> XML -> XSL processing servlet -> HTML XML transformed by MQ XML directly rendered in a browser using XSL XML used with MQ Integrator to communicate between business or systems XML with Java Messaging Service (JMS) XML provides configuration information for systems
  • 33. XML Tools Changing drastically / quickly Standards are moving quickly, tools keeping up Java is preferred development language Unicode Tool Categories XML Parsers Database support Messaging product support XML Editors XSL Processors Java class libraries digital signature visual beans
  • 34. IBM XML Tools Available from Alphaworks (www.alphaworks.ibm.com) XML Parser for Java (XML4J) Lotus XSL XML Productivity Kit for Java XML Security Suite Xeena Bean Markup Language P3P XML Diff and Merge, XML TreeDiff XML Parser for C++ WebSphere MQ Series DB2 6.1
  • 35. DB2 XML and Text Extenders DB2 Table CLOB XML Doc FileSystem XML Doc Data Link Store an XML document in DB2 as column or collection of fields Store XML document in an external file - Data Links Manager New structured XML search with DB2 text extender searches XML stored in column enables searches to be narrowed more meaningfully by structure as well as content
  • 36. XML and MQSeries MQSeries Integrator Bridging XML and legacy messages XML is the preferred message format Dictionary support for messages Routing and processing based on message content XML used internally Configuration management Links between tools and runtime MQSeries Family Consolidation using XML Common set of GUI tools Published interfaces
  • 37. alphaWorks XML Technologies... XML Parser for Java (XML4J) - the core component for XML solutions, and its companion XML Productivity Kit DataCraft for creating and publishing XML views of databases LotusXSL processor to construct HTML for viewing by a web browser from an XML document TexML - this processor allows you to produce typeset output from XML P3P Parser - an XML solution which implements Platform for Privacy Preferences (P3P) RDF for XML - Resource Description Framework processor written in Java for building, querying, and manipulating RDF database structures.
  • 38. alphaWorks XML Technologies... Dynamic XML for automating Java interpretation of XML PatML for converting XML documents to other languages XML TreeDiff used to identify and update DOM trees just like data files XML BeanMaker to generate Java bean classes from an XML DTD TaskGuide Viewer - an XML-based tool for creating wizards. Bean Markup Language (BML) for configuring Java components XML EditorMaker for building XML visual editors XML Enabler for viewing XML in various browsers via servlet
  • 39. External IBM XML Website fo in L XM of ce ur so st be ur Yo
  • 40. DEMO
  • 41. References Useful Sites www.ibm.com/xml www.ibm.com/java www.alphaworks.ibm.com www.finetuning.com www.xml.com www.xml.org www.sun.com/java