Mazda Use of Third Generation Xml Tools

771 views

Published on

Experience Mazda Zoom Zoom Lifestyle and Culture by Visiting and joining the Official Mazda Community at http://www.MazdaCommunity.org for additional insight into the Zoom Zoom Lifestyle and special offers for Mazda Community Members. If you live in Arizona, check out CardinaleWay Mazda's eCommerce website at http://www.Cardinale-Way-Mazda.com

Published in: Automotive, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
771
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Mazda Use of Third Generation Xml Tools

  1. 1. Third Generation XML Tools Michael Leventhal [email_address]
  2. 2. Generations Ubiquity Infrastructure Programming Standard Correctness Performance Simplification Commodity Cost 3rd 2nd 1st Reliability Delivery Application Repository Standardization Data Description Toolkits Transformation Interfaces Standards Presentation Tiers Tools Parsing Browsing Editing
  3. 3. Agenda <ul><li>Characterizing XML Tool Evolution – Semantic Space of Change </li></ul><ul><li>Key Ideas Underlying the Next Generation </li></ul><ul><ul><li>XML Programming Models – Universal XML Development </li></ul></ul><ul><ul><li>High Performance XML, e.g., Streaming </li></ul></ul><ul><ul><li>XML as Infrastructure – Reliability at the core of the computing platform, merging of hardware and software, integration into the application framework </li></ul></ul><ul><li>Whither else? Your feedback. </li></ul>
  4. 4. Schema to Java Generation <ul><li>Lessens development time and resource needs through removal of required of XML experience needed for generic XML APIs such as DOM and SAX. </li></ul><ul><li>Superior type checking; most constraint and structure checking is done at compilation time as the Java classes have been generated from the schema. </li></ul><ul><li>Performance worse than DOM with Validation </li></ul>Generation of Java APIs from XML Schemas Developers program against these Schema-specific APIs
  5. 5. Schema to Java - Tools <ul><li>JAXB Implementation http://java.sun.com/xml/ </li></ul><ul><li>Castor http://www.castor.org/ </li></ul><ul><li>XML Binder for Java http://www.breezefactor.com </li></ul><ul><li>Zeus http://zeus.enhydra.org/ </li></ul><ul><li>Schema2Java http://www.creativescience.com </li></ul><ul><li>DocSOAP XDK XGen http://www.commerceone.com/developer </li></ul>
  6. 6. Schema to Java Generation XML Schema Java Classes Generates XML Instance Java Objects Converts XGen DT Schema Compiler XML Schema Java Classes XGen RT Runtime XML Instance Java Objects
  7. 7. Schema to Java Example <xsd:schema targetNamespace=&quot;rrn:com:commerceone:schemas/xdk/samples/Car.xsd&quot; xmlns=&quot;rrn:com:commerceone:schemas/xdk/samples/Car.xsd&quot; xmlns:xsd=&quot;http://www.w3.org/2001/XMLSchema&quot;> <xsd:element name=&quot;Car&quot; type=&quot;CarType&quot;/> <xsd:complexType name=&quot;CarType&quot;> <xsd:sequence> <xsd:element name=&quot;Manufacturer&quot; type=&quot;xsd:string&quot;/> <xsd:element name=&quot;Model&quot; type=&quot;xsd:string&quot;/> <xsd:element name=&quot;Year&quot; type=&quot;xsd:int&quot;/> <xsd:element name=&quot;Color&quot; type=&quot;xsd:string&quot;/> </xsd:sequence> <xsd:attribute name=&quot;ForSale&quot; type=&quot;xsd:boolean&quot;/> </xsd:complexType> </xsd:schema> <?xml version=&quot;1.0&quot;?> <prefix_0:Car xmlns:prefix_0=&quot;rrn:com.commerceone:schemas/xdk/samples/Car.xsd&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; ForSale=&quot;true&quot;><Manufacturer>Mazda</Manufacturer><Model>Miata MX-5</Model><Year>91</Year><Color>Blue</Color></prefix_0:Car>
  8. 8. <xsd:element name=&quot;Car&quot; type=&quot;CarType&quot;/> <xsd:complexType name=&quot;CarType&quot;> <xsd:sequence> <xsd:element name=&quot;Manufacturer&quot; type=&quot;xsd:string&quot;/> <xsd:element name=&quot;Model&quot; type=&quot;xsd:string&quot;/> <xsd:element name=&quot;Year&quot; type=&quot;xsd:int&quot;/> <xsd:element name=&quot;Color&quot; type=&quot;xsd:string&quot;/> </xsd:sequence> <xsd:attribute name=&quot;ForSale&quot; type=&quot;xsd:boolean&quot;/> </xsd:complexType> </xsd:schema> <?xml version=&quot;1.0&quot;?> <prefix_0:Car xmlns:prefix_0=&quot;rrn:…/Car.xsd“ ForSale=&quot;true&quot;> <Manufacturer>Mazda</Manufacturer> <Model>Miata MX-5</Model> <Year>91</Year><Color>Blue</Color> </prefix_0:Car>
  9. 9. Schema to Java Example package com.commerceone.samples.xdk;   import com.commerceone.schemas.xdk.samples.Car_xsd.Car; import com.commerceone.schemas.xdk.samples.Car_xsd.types.CarType;   import com.commerceone.xdk.castor.types.*; import com.commerceone.xdk.castor.excp.ConstraintValidationException;   import java.io.OutputStreamWriter; import java.io.Writer;   public class CarCreator { public static void main(String[] args) { try { CarCreator cc = new CarCreator(); Car car = cc.makeCar(); car.marshal(new OutputStreamWriter(System.out)); } catch(Exception e) { e.printStackTrace(); } } public Car makeCar() throws ConstraintValidationException { Car car = new Car(); CarType ct = car.getCarTypeComplexType();   ct.setColor(new XString(&quot;Blue&quot;)); ct.setManufacturer(new XString(&quot;Mazda&quot;)); ct.setModel(new XString(&quot;Miata MX-5&quot;)); ct.setYear(new XInt(91)); ct.setForSale_Attribute(new XBoolean(true));   return car; } }
  10. 10. public class CarCreator { public static void main(String[] args) { try { CarCreator cc = new CarCreator(); Car car = cc.makeCar(); car.marshal(new OutputStreamWriter(System.out)); } catch(Exception e) { e.printStackTrace(); } } public Car makeCar()throws ConstraintValidationException { Car car = new Car(); CarType ct = car.getCarTypeComplexType();   ct.setColor(new XString(&quot;Blue&quot;)); ct.setManufacturer(new XString(&quot;Mazda&quot;)); ct.setModel(new XString(&quot;Miata MX-5&quot;)); ct.setYear(new XInt(91)); ct.setForSale_Attribute(new XBoolean(true));   return car; } }
  11. 11. Schema to Java in Web Services DocSOAP<->Java SOAP-RPC<->Java
  12. 12. Schema to Java – Schema Feature Coverage
  13. 13. Schema to Java – Schema Feature Coverage
  14. 14. Schema to Java - Performance                         DOM with Validation Illustrative Schema to Java Tool CPU Secs Size Marshalling Unmarshalling Round Trip   First run Average after first run First run Average after first run First run Average after first run 1 Mb 1.8 1.3 19.9 10.4 21.7 11.7 3 Mb 4.9 3.7 41.0 29.9 46.0 33.6 5 Mb 8.9 7.0 60.1 50.5 69.0 57.5 Size Marshalling Unmarshalling Round Trip   First run Average after first run First run Average after first run First run Average after first run 1 Mb 1.0 0.4 5.8 3.5 6.8 3.9 3 Mb 3.0 1.3 13.2 10.6 16.2 11.9 5 Mb 4.2 3.2 20.8 17.5 25.1 20.7
  15. 15. Schema to Java - Performance Memory Kbs Illustrative Schema to Java Tool Rule of thumb for DOM: Memory use ~4X size of instance     Init Unmarshalling Marshalling     Peak Done Peak Done Peak Done xCBL 1 meg 1730 1673 9845 9553 15455 9574 xCBL 3 meg 1734 1673 20764 17657 27765 17677 xCBL 5 meg 1769 1674 31556 25746 39183 25766 xCBL3.0 1 meg 1802 1674 23344 16835 24751 16875 xCBL3.0 3 meg 1790 1673 33142 25830 39134 25870 xCBL3.0 5 meg 1803 1673 45113 34700 52206 34741
  16. 16. Programming Models: XOBE XML Schema XML Objects Instances of Generated by XML constructors http://www.research.avayalabs.com/user/wadler/planx/planx-eproceed/papers/E00-699879232.pdf See Kempa, Martin and Linnemann, Volker, “On XML Objects” Car makeCar() { Car myCar; myCar = <Car> <Manufacturer>Mazda</Manufacturer> <Model>Miata MX-5</Model> <Year>91</Year> <Color>Blue</Color> </Car>; Return myCar; } <ul><li>Uses XML Schema directly as definition of classes for XML objects; construct XML objects with parameterized XML expressions </li></ul><ul><li>Eliminates distinction between string and object representation of XML documents </li></ul><ul><li>Compiler statically guarantees validity; no need for special runtime checking or checking at marshalling </li></ul><ul><li>Similar: ECMAScript (BEA XML Scripting), Water (http://www.waterlang.org) </li></ul>
  17. 17. Car makeCar() { Car myCar; myCar = <Car> <Manufacturer>Mazda</Manufacturer> <Model>Miata MX-5</Model> <Year>91</Year> <Color>Blue</Color> </Car>; Return myCar;
  18. 18. Stream Processing - Tools Builds complex XML processing on SAX events to achieve high-performance and ultra-low memory usage compared to tree-construction approaches <ul><li>XSLT-style Transformation </li></ul><ul><ul><li>STX http://stx.sourceforge.net/ Stream Index (SIX) </li></ul></ul><ul><ul><li>XST Smart Streaming </li></ul></ul><ul><li>XPath </li></ul><ul><ul><li>XMLTK http://sourceforge.net/projects/ xmltk </li></ul></ul><ul><ul><li>χαος http://www.research.ibm.com/xaos/applications.html </li></ul></ul><ul><li>SOAP Processing </li></ul><ul><ul><li>Axis http://ws.apache.org/axis/ </li></ul></ul><ul><ul><li>DocSOAP XDK http://www.commerceone.com/developer </li></ul></ul>
  19. 19. Stream Processing-Algorithms <ul><li>Stream processing is not inherently faster than DOM tree-based approaches; improperly applied it can be slower than DOM. It should always be more memory-efficient than DOM. Some approaches consist mainly of limiting the application domain to problems that can usually be efficiently solved by a simple streaming algorithm. Example: XPP, simplified XML parser. </li></ul><ul><li>Stream processing is not necessarily just using SAX events. It is a different approach to solving computational problems which uses a variety of sophisticated algorithms. </li></ul><ul><ul><li>SIX (XMLTK) uses event marker indices. </li></ul></ul><ul><ul><li>Smart Streaming (XST) combines DOM and SAX and analyzing when to stream </li></ul></ul><ul><ul><li>X-dag ( χαος) converts backward constraints into forward constraints </li></ul></ul>
  20. 20. Stream Processing – Simplifying the problem Source: IBM Developer Works, XML in Java: Document models, Part 1: Performance, Dennis M. Sosnoski, September 2001 <ul><li>XPP: XML Pull Parser </li></ul><ul><li>Streaming </li></ul><ul><li>XML Subset </li></ul><ul><li>No Validation </li></ul><ul><li>No entities, PIs, Comments </li></ul><ul><li>Lazy, on-demand tree </li></ul><ul><li>Supports namespaces </li></ul>http://www.extreme.indiana.edu/ xgws/xsoap/xpp/ Document Modify
  21. 21. Stream Processing - XMLTK XMLTK Stream Processing Tools Stream Function Description xsort Sorts an XML Stream xagg Computes an aggregate xnest Groups elements based on key equality or number xflatten Flattens collections xdelete Removes elements or attributes xpair Replicates an element multiple times, Pairing it with each element in a collection xhead Retains only a prefix of a collection xtail Retains only a suffix of a collection file2xml Generates an XML stream for the dir file directory hierarchy
  22. 22. Stream Processing - XMLTK <ul><li>XMLTK XSort Performance vs Xalan Sort </li></ul><ul><li>Sophisticated streaming algorithm can produce both low memory and high performance </li></ul><ul><li>S tream I nde X Algorithm </li></ul><ul><li>Additional binary stream consisting of beginOffset, endOffset pairs for each XML element </li></ul><ul><li>Allows characters to be skipped </li></ul><ul><li>Small offsets can be skipped to reduce SIX stream and number of jumps </li></ul>Data Size (KB) Xalan (sec) Xsort (sec) 0.41 0.08 0.00 4.91 0.10 0.00 76.22 0.29 0.03 991.79 2.78 0.35 9671.42 29.42 3.54 100964.43 - 35.52 1009653.71 - 358.47
  23. 23. Smart Streaming <ContractReferences> <ListOfContract> <Contract> <ContractID> <Identifier> <Agency> …… </Agency> <Ident>0088-858398</Ident> </Identifier> </ListOfContract> </ContractReferences> <Identifier> <Agency> …… <Ident>0088-858396</Ident> </Identifier> <Agency> …… </Agency> <Ident>0088-858398</Ident> Source XML Document <ContractReferences> <ListOfContract> <Contract> <ContractID> <Identifier> <Agency> …… </Agency> <Ident>0088-858398</Ident> </Identifier> </ListOfContract> </ContractReferences> <Identifier> <Agency> …… </Agency> <Ident>0088-858396</Ident> </Identifier> <Agency> …… </Agency> <Ident>0088858398</Ident> Target XML Document
  24. 24. Smart Streaming  Streaming  Streaming  Buffering  Streaming < ContractReferences > <ListOfContract> <Contract> <ContractID> <Identifier> <Agency> …… </ Agency> <Ident>0088-858398</I dent> </ Identifier> </ListOfContract> < /ContractReferences > < Identifier > <Agency> …… <Ident>0088-858396</Ident> < /Identifier > < Agency > …… < /Agency > < Ident >0088-858398 </Ident >
  25. 25. Smart Streaming - XST <xst:templates version=&quot;1.0&quot; …… <xst:template name=&quot;Agency&quot; deferred=&quot;true&quot;> <Ident><xst:val-of select=&quot;$Ident“></Ident> <xst:var name=&quot;AgencyDescription&quot;/> <xst:if test=&quot;$AgencyDescription&quot;> <AgencyDescription> <xst:val-of select=&quot;$AgencyDescription&quot;/> </AgencyDescription> </xst:if> </xst:template> …… </xst:templates> <xst:templates version=&quot;1.0&quot; …… <xst:template name=&quot;Ident&quot;> <xst:var name=&quot;Ident&quot;/> </xst:template> …… </xst:templates> <?xml version=&quot;1.0&quot;?> <xsl:stylesheet version=&quot;1.0&quot; xmlns:xsl=&quot;http://www.w3.org/1999/XSL/Transform&quot;> <xsl:template match=&quot;/&quot;> <xsl:apply-templates select = &quot;*&quot;/> </xsl:template> <xsl:template match= &quot;*&quot; > <xsl:copy><xsl:copy-of select=&quot;@*&quot;/> <xsl:apply-templates/> </xsl:copy> </xsl:template> <xsl:template match=&quot;Agency&quot;> <Agency> <Ident><xsl:value-of select=&quot;//Ident&quot;/></Ident> <xsl:variable name=&quot;AgencyDescription&quot; select=&quot;//AgencyDescription&quot;/> <xsl:if test=&quot;$AgencyDescription&quot;> <AgencyDescription><xsl:value-of select=&quot;$AgencyDescription&quot;/></AgencyDescription> </xsl:if> </Agency> </xsl:template> <xsl:template match=&quot;Ident&quot;/> </xsl:stylesheet> XST XSLT
  26. 26. Streaming – Transformation Automation Transformation Rules Schema Analysis Template Generator   Streaming Templates  Template Generation <ul><li>Template generation process can automate creation of streaming transformations. </li></ul><ul><li>Transformation rules can be created in a visual tool like Contivo. </li></ul><ul><li>Schema is analyzed to augment mapping rules. </li></ul><ul><li>May be unnecessary to introduce YATL (Yet Another Transformation Language). </li></ul>
  27. 27. Streaming – Memory/CPU Performance
  28. 28. Streaming – Memory/CPU Performance
  29. 29. Web Services Infrastructure By one estimate, less than 2% of all enterprise networks traffic in 2002 was XML. That will increase to about 25% of all LAN traffic by 2006. Source: ZapThink, “Solving The Enterprise XML Processing Problem” Much of that traffic will be due to Web Services. XML-based SOAP should replace most other message-oriented protocols.
  30. 30. Web Services Infrastructure <ul><li>Implications for 3 rd Generation Tools </li></ul><ul><li>XML has to become protocol-level safe and truly interoperable. There is a long way to go but W3C, WS-I and other consortiums are focusing intently on this. </li></ul><ul><li>High performance and scalability will be at a premium. </li></ul><ul><li>Market will bear higher prices for high-end tools. </li></ul><ul><li>Interoperability and performance-related simplifications of XML and related standards will receive a second look. </li></ul>
  31. 31. Web Services Infrastructure <ul><li>Major Interoperability Issues Faced Today - Many </li></ul><ul><li>Support for XML Schema </li></ul><ul><li>Support for Namespaces </li></ul><ul><li>Canonicalization of XML Documents </li></ul><ul><li>XML Signing </li></ul><ul><li>Links and References between Message Parts </li></ul><ul><li>Handling of Document Subsets </li></ul><ul><li>WSDL Binding to SOAP </li></ul>
  32. 32. Web Services Infrastructure Case Study: DocSOAP XDK Embedded in the Commerce One Conductor Web Services Platform <ul><li>First implementation of an XML document-centric Web Services toolkit </li></ul><ul><li>High performance handling of large XML document message parts </li></ul><ul><li>Highest level of support of XML Schema, namespaces, document fragments, inter-message references </li></ul><ul><li>Major design emphasis on ensuring integrity of messages </li></ul>
  33. 33. Web Service Infrastructure transport Transport headers SOAP Header SOAP Payload Header Block D O C S O A P D O C U M E N T D O C U M E N T FRAMEWORK FRAMEWORK XGen RT UniParser A P P L I C A T I O N Generated Schema API DOM Interface Schema DOM Bean Instance Schema unmarshall marshall validate XGen DT Commerce One Conductor
  34. 34. Web Services Infrastructure Images provided by and used with the permission of DataPower Technology <ul><li>Case Study: DataPower Network Devices (XS40 XML Security Gateway and XA3 XML Accelerator) </li></ul><ul><li>High-speed XML Encryption and Signing and XSLT transformation implemented in hardware and firmware </li></ul><ul><li>Integrated with Altova and Excelon IDEs – applications leverage a common runtime in the network, software and hardware converge </li></ul>
  35. 35. Web Services Infrastructure <ul><li>Common Layer of XML Application Services, Development Tools and Runtimes in Software Frameworks such as .NET and J2EE </li></ul><ul><li>Sun JavaX – the JAXes </li></ul><ul><li>JAXM - Messaging </li></ul><ul><li>JAXP - Parsing </li></ul><ul><li>JAX-RPC – Distributed Processing </li></ul><ul><li>JAXB – Schema to Java Generation </li></ul><ul><li>JAXR – XML Registries </li></ul>
  36. 36. Not Hot? (Debatable) <ul><li>Native XML Databases/XML-DBMS Convergence </li></ul><ul><li>Publishing/XSL-FO </li></ul><ul><li>Client apps/ECMAScript-JavaScript/ embedded Web Services </li></ul><ul><li>Browsable XML </li></ul><ul><li>Semantic Web/RDF/Topic Maps/Ontologies </li></ul>
  37. 37. Presentation An HTML version of this presentation is available at: http://www.textscience.com/papers/ThirdGenerationXMLTools.html Powerpoint at: http://www.textscience.com/papers/ThirdGenerationXMLTools.ppt The presenter, Michael Leventhal, can be reached at michael@textscience.com.

×