1 / 73

XML & Java for DotCOM

XML & Java for DotCOM. Raymond Gao E-Commerce Architect DotCOM Practice Sun Microsystems, Inc. About Me:. Published Work: eAI Journal, December Edition, 2000 - "JMS: A Portable Framework for Connecting the Enterprise"

dillan
Download Presentation

XML & Java for DotCOM

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. XML & Java for DotCOM Raymond Gao E-Commerce Architect DotCOM Practice Sun Microsystems, Inc.

  2. About Me: • Published Work: • eAI Journal, December Edition, 2000 - "JMS: A Portable Framework for Connecting the Enterprise" • Enterprise Linux Journal, December, 2000 (2nd Cover) - "Java on Linux, A Clear Choice for Open Source Technology" (Guest Editor) • Speaking Engagments: • "XML and Java for DotCom" - Java Plus 2000 Conference, San Jose, CA

  3. Introduction The Network is the Computer

  4. The Internet Phenomenon • As of 2000, the global online population is > 400 Million people. • 38 Years to get 300 Million Radio Listeners • 15 Years for TV viewers • By 2004, Worldwide Net-Commerce spending will apprach $6.8 trillion. source: Forrester Research

  5. Internet Means Big Business • By 2004, the worldwide market for packaged E-Commerce software will reach $14.5 billion. (source: IDC) • The J2EE Advantage Art Technology, IBM, Oracle, BEA Software, etc. • Marketing XML and Open Source Technologies

  6. Internet Is Changing the World Internet has fundamentally altered the business landscape and transformed the global business into a giant borderless exchange with information valued as the currency. JMS: A Portable Framework for Connecting the Enterprise eAI-Journal, December 2000

  7. Computing In The Age Of Internet • Portable Technology & Open/Non-proprietary technology. • Pluggable and reusable modules. • The 4As and 8-abilities. • Anytime, Anywhere, Any device, and AnyOne • Scalability, Availability, Manageability, Compatibility, Security, Stability, Portability, and Flexibility.

  8. The Next Generation Internet • Wireless Internet Access Devices will become pervasive • By 2002, there will be 1.3 billion subscribers of wireless internet capable devices (source: IDC) • A plethora of Wireless Devices: internet applicances, gaming, TV, household, etc. • AOL had 1.5 million subscriber in 1994. • The Rise of Web Agent Technology • Scalability and Inter-Operability

  9. Some Examples Of Next Generation Internet Devices TV and Audio/Video PDAs Cell Phones Automobiles Pagers Trading Partner's Server

  10. What're The Ramifications? • The old HTML server model will become OBSOLETE. • Emergance of new Technology and Standards. • SOAP, UDDI, IIOP, J2EE, SVG, ebXML, etc • Open source Technology will play even greater roles • Linux, Apache, Tomcat, etc. • GNOME and Solaris

  11. The HTML Server Model In the HTML Server Model, content is presented in the HTML format. It cannot service non-HTML clients.

  12. Why HTML Server Model Won't Work • HTML tag set is inflexible. • Tag’s semantics cannot be changed • Data structure is lost during the HTML translation process • Data validation is not supported i.e. broken <a href > links • Hard to interface with the app-logic • HTML document cannot be directly mapped backend to a database

  13. Some Symptoms • Broken links. • NO support for PDAs and Wireless devices. • Difficult to find useful information • 4 Billion pages by January - only 0.01% is useful for a person (USA Today, July 11)

  14. XML’s Philosophy XML derives from the philosophy that data belongs to its creators and that content providers are best served by data format that does not bind them to any particular script languages, authoring tools, and delivery engines but provides a standardized, vendor-independent, level playing field… Jon Bosak “XML, Java, and the Future of the Web”

  15. XML-Info Server Model A Better Approach

  16. What Is XML? • eXtensible Markup metaLanguage • A method for structuring portable data • A subset of SGML (ISO 8879) • A meta-language - supports unlimited numbers of context-relevant tags and attribute names. • The current version of XML 1.0 is in proposed recommendation stage as of 1/19/2001.

  17. XML vs. HTML

  18. What Makes XML The Ideal Data Format • Extensible - Allowing user to define new tags and schemas (DTD) that are context-relevant • Reusable - Switching between different views without the need for new downloads • Structured - Providing a hierarchical model that facilitates Object-Orient Programming and resembles the database • Validation & well formed - Content and syntax checking

  19. Introduction to XML

  20. Plan of Presentation XML portion • XML Review • Syntax & Rules • DTD • XSL and the rest (There will a quiz?) • 3-Tiered XML Model • How XML relates to Java

  21. General Rules About XML • XML is case sensitive. • All XML documents must begin with the prolog • <?xml version = “1.0”?> Correct • <?XML version = “1.0”?> Incorrect • XML must be Well-Formed - A document that is not well-formed is not XML. • Can use optional DTD for document validation.

  22. Well-Formed Rules for XML Elements • Must have explicit starting and ending tags for every elements including empty tags. • <tag>text</tag> or <tag/> Correct • <stuff><tag-a>words</stuff> Incorrect • All XML document can have only one root element (/). • No element overlap allowed. • <a>A<b>B</a></b>

  23. Well-Formed Rules for XML Attributes • Space(s) is used as the separator, no comma and period. <apple color=“red” taste=“sweet”> Correct <apple_color=“green”,taste=“sour”> Incorrect • Each attribute must have a valid name. <apple color=“” taste=“sweet”> Correct <apple “green” the taste=“sour”> Incorrect • Equal-sign and quotes are required.

  24. An Example of Well-Formed XML Document <?xml version=“1.0” standalone=“no” ?> <!DOCTYPE play SYSTEM “play.dtd”> <play location = “Broadway”> <playname> Hamlet </playname> <author> Shakespare </author> <type> Tragedy </type> </play>

  25. DTD Syntax(Document Type Declaration) • How to Link DTD to your XML document • How to declare an XML element in the DTD • How to add attribute(s) to an XML element in the DTD

  26. Linking DTD To An XML Document • Using an external DTD: <?xml version=“1.0”standalone=“no” ?> <!DOCTYPE mydtd SYSTEM “MY.DTD”> ... ... Rest of your XML document ... • Using an internal DTD: <?xml version=“1.0”standalone=“yes” ?> <!DOCTYPE mydtd [... internal DTD ...]> ... ... Rest of your XML document ...

  27. Declaring An XML Element • Syntax: <!ELEMENT name (content model) > • Special Symbols: ? Zero or One + One of More * Zero or more #PCDATA Character data • Example <!ELEMENT play (playname, author, type?)> <!ELEMENT playname (#PCDATA)>

  28. Adding Attribute(s) • If the XML element is the noun, then the XML attribute is the adjective. • Syntax: <!ATTLIST element_name attribute value default_value> • Example: • <!ELEMENT play (playname, author, type?)> <!ATTLIST play date CDATA #IMPLIED location CDATA #REQUIRED time (weekday | weekend) “weekend”>

  29. An Example DTD <!-- This is the DTD for the play example --> <!ELEMENT play (playname, author, type?)> <!ATTLIST play date CDATA #IMPLIED location CDATA #REQUIRED time (weekday | weekend) “weekend”> <!-- Information about a play --> <!ELEMENT playname (#PCDATA)> <!ELEMENT author (#PCDATA)> <!ELEMENT type (Tragedy | Comedy | Drama)>

  30. XML Reference Card

  31. XSL (eXtensible StyleSheet Layout) • XSL is itself a XML document. • XSL has two parts: 1. XSLT - XML Transformation. Takes an XML document and outputs into a HTML, WML, or XML document. (now in W3C version 1.1 working draft) 2. XSLFO - XML formatting. XML equivalent of CSS (Cascading StyleSheet)

  32. My Electronic Business Card

  33. Do You Know The DTD For This XML Document?

  34. The Answer – The DTD

  35. The XSL

  36. XML & 3-Tier Architecture

  37. Justification For Using 3-Tier Architecture • Scalable - Difficult to forecast web-site load & dynamic system capacity adjustment according to demand • Adaptable - Business process can change • Reusable - Component architecture • Maintenance & Improvement • Cycle Time & Cost

  38. Why Use 3-Tier Architecture For XML Programming • Model after MVC (Model, View, Controller). • Make better architecture sense. • More adaptable - evolve according to changes in the business process. • Integrate with other languages - Java, UML, C++. (S/W Methodolgy) • Distributed Computing. • Increase portability.

  39. What Are The 3 XML Tiers? • Content • Interchange • Structure

  40. The Content Tier • Purpose: contain the “instance” information about the data to be consumed by the end-user. • Usage: Holds the actual data content. • Examples: XML, WML, and XHTML documents.

  41. The Structure Tier • Purpose: hold the schema information about a group of XML document(s). • Usage: abstract & high-level. i.e. for document validation and binds to the content. • Examples: DTD, XML Schema, RDF, Namespaces, ebXML, SOAP, fpML, JSP spec, etc.

  42. The Interchange Tier • Purpose - formatting & translating the XML data into appropriate views for the end-user’s application and connecting XML documents. • Usage: Displaying appropriate view, linking, and transforming documents, etc. • Examples: XSL, XSLT, XPath, XFormat, XPointer, XLink.

  43. Some Useful Websites Related to XML • http://www.xml.com • http://www.xmlinfo.com • http://www.oasis-open.org/Cover/ • http://www.wrox.com • http://www.w3.org/XML/ • http://www.javasoft.com/XML • http://www.w3.org/XML/Schema

  44. Java and XML

  45. Why XML Needs Java • XML is data; and data does not have behaviors • XML has no legs - XML did not specify which transport protocol to use • XML presentation is dependent on the OS platform - different platforms use different encoding schemes <CR><LF> on unix, dos, & mac • Security & Lifecycle - Schema will evolve

  46. Software Engineering Meets Business Domain • Can you buy a car with a Java object? - Exchange Java objects can be inefficient • The world is not made up entirely of JVMs - Legacy applications, native code programs, … • Distributed computing & security • Send messages that everyone can understand

  47. Java And XML Are Complementary Technology • Portable data; Portable code • N-Tier architecture • Distributed computing • Security model • Growth of the smart internet - agent technology • Realization for wireless devices • Programming concept vs. computing in the real world

  48. Is Your Application Portable? • True && False => False (XML + native code) • False && True => False (HTML + Java) • True && True => True (XML + Java)

  49. How XML fits into the Java Framework • Established Standards: • EJB already uses XML for deployment descriptor (DD). • JSP offers Tag library - observes XML convention, (Pipelines.) • JMS (Java Message Service) • Upcoming Technology: • EJB 2.0 and asynchronous transaction. • JAXP, JAXM, XMI, ...

  50. A Model Of Using Java For The Web

More Related