54
1 Java & XML Jian-Hua Yeh [email protected]

Java & XMLriver.glis.ntnu.edu.tw/page/liberary-museum_discuss/06.pdf · 2004. 3. 16. · Web services to solve problems: Dynamic generated web content Easy method for accessing online

  • Upload
    others

  • View
    0

  • Download
    0

Embed Size (px)

Citation preview

  • 1

    Java & XML

    Jian-Hua [email protected]

  • 2

    World’s Earliest Library?Where?When?

  • 3

    亞述巴尼拔圖書館

    Nineveh, Assyria, Mesopotamia (Iraq)668 B.C. ~ 627 B.C.~30,000 cuneiform “books”Discovered 1849 A.D.

  • 4

    OutlineIntroduction to Java technologyTrend of application frameworkThe XML serverXML support in Java technology spectrumNative XML databaseConclusion

  • 5

    What is Java?Java is a general-purpose, concurrent, class-based, object-oriented language.“Green team” in 1991“Oak” languageGoing public in May 1995.

  • 6

    The Major Trends in Computing

  • 7

    OutlineIntroduction to Java technologyTrend of application frameworkThe XML serverXML support in Java technology spectrumNative XML databaseConclusion

  • 8

    Tiered TechnologyEvolved from client/server modelComplex business logic is hard to be handled by C/S modelTask division into several tier of business processScalable, accessible, manageable

  • 9

    Application Server TechnologyA hybrid issue of database, middle ware, communication, and presentation technology.Targets:

    AvailabilitySecurityReliabilityExtensibility

  • 10

    Foundations of App. ServerThe programming language, compiler, running environment(such as VMs).Run-time library(supporting library)A component model

    provides a well-defined way for tools to access a software package's methods and properties

    A RPC mechanism

  • 11

    The Market Growth

  • 12

    Application Server ArchitectureTypical 3-tier architecture

    Presentation tierBusiness tierData tier

  • 13

    A Typical 3-tier Model

  • 14

    Container ModelManagement of components

    Presentation componentsApplication logic componentsData components

    IssuesNaming schemeComponent connectivityPersistent consistency

  • 15

    Two Major CampsSunONE

    J2EE app. server technologySingle language (Java), bytecode, JVM

    Microsoft .NET.NET app. server technologyMulti-language, C# code, .NET Windows

  • 16

    J2EE

  • 17

    .NET

  • 18

    Deployment Model – J2EE

  • 19

    Deployment Model – .NET

  • 20

    OutlineIntroduction to Java technologyTrend of application frameworkThe XML serverXML support in Java technology spectrumNative XML databaseConclusion

  • 21

    What is XML?Proposed by W3C at the end of 1996SGML-derivedA meta-language for new tagging languageXML1.0 Recommendation released at Feb. 1998Supporting

    Sun, Microsoft, Netscape, Adobe, ArborText, etc.

  • 22

    What is XML? (2)eXtensible Markup LanguageTag-basedOpen and cross-platformStructural data representationAs data and as documentSuitable for data exchange

  • 23

    Wile E. Coyote, Death Valley, CA

    Customer asked that we guarantee return rights if these items should fail in desert conditions. This was approved by Marty Melliore, general manager.

    Camp Mertz

  • 24

    Why XML?HTML is not enough, no structural data handling capabilityRecommended by W3C, an open standardThe push of enterprise integrationTo break the stovepipe system, from vertical to horizontalThe need of B2B, B2C integrationPlatform independent

  • 25

    Traditional Data Exchange HandlingPrivate protocol for stovepipe systemOpen standard for data exchange

    RPCRMICORBACOM

  • 26

    New Strategy of Data ExchangeText-basedTag-orientedSelf-descriptiveData Type Definition

  • 27

    XML DetailsComponents

    DTD/SchemaXML content

    Processing modelsEvent driven model: SAX

    • A document is treated as a set of events

    Structural model: DOM• A document is represented as a tree structure

  • 28

    XML Server IntroductionWhy XML server?

    Comply with enterprise service model: client/middle/EIS structure

    Common components can consists of 3rd party software vendors

    XML parser, XSL processor, etc.

  • 29

    XML Server Architecture

  • 30

    XML Server Architecture (2)Key aspects

    Client• PDA, browser, Web server, other XML server,

    etc.Communication protocol

    • Email, HTTP, FTP, EJB, RMI, IIOP, COM, etc.Key servicesData object

    • Relational database, object data source, etc.

  • 31

    XML Server ComponentsClientCommunication serviceDocument handlerData object access moduleXML core service

  • 32

    Key Services of XML ServerBasic services

    Communication services, text stream services

    XML core servicesParser, DOM, XSL, XQL

    Data access moduleDocument handling modules

    Data translationXML creation(including DTD generation)

  • 33

    Data Access ModuleDatabase operation services

    Linkage managementDatabase authenticationJDBC/ODBC supportTransaction processing

    Data processing servicesMapping/linking servicesTemplate processingData object generation

  • 34

    An Operation Example

  • 35

    OutlineIntroduction to Java technologyTrend of application frameworkThe XML serverXML support in Java technology spectrumNative XML databaseConclusion

  • 36

    Java/XML technologiesXML processingData bindingRemote communicationService registryMessaging

  • 37

    Java for XML ProcessingJAXP (Java API for XML Processing)

    SAX (Simple API for XML) parser• Event-based XML parsing

    DOM (Document Object Model) parser• Model-based XML parsing

    XSLT (XML Stylesheet Language for Transformations) processor

    • Support SAX, DOM, stream-specific processing

  • 38

    Java for XML Data BindingJAXB (Java Architecture for XML Binding)

    Schema-basedValidationRepresenting XML content

  • 39

    Java for XML CommunicationJAX-RPC (Java API for XML-based RPC)

    RPC-based Web serviceSOAP-based (Simple Object Access Protocol)Discoverable by using JAXR (*later*)

  • 40

    Java for XML RegistriesJAXR (Java API for XML Registries)

    Service registrationService lookup

  • 41

    Java for XML MessagingJAXM (Java API for XML Messaging)

    Message provider

    SAAJ (SOAP with Attachments API for Java)

    Message population with attachment

  • 42

    What Is SOAP?SOAP is an XML based protocolUsed by software components and applications to communicate using standard Internet HTTPProvides a simple and lightweight mechanism for exchanging structured and typed information between peers in a decentralized, distributed environment using XML.

  • 43

    Why SOAP?The need of communication between applicationsCurrent distributed object access protocols

    DCOMCORBAEJB

    So why don’t we use HTTP?

  • 44

    Features of SOAPSOAP is a lightweight communication protocolSOAP is for communication between applicationsSOAP is designed to communicate via HTTPSOAP is not tied to any component technology

  • 45

    Features of SOAP (2)SOAP is not tied to any programming languageSOAP is based on XMLSOAP is simple and extensibleSOAP is proposed to W3CSOAP will hopefully become a W3C standard

  • 46

    SOAP Message StructureAn XML documentStructure

    SOAP envelope (mandatory)• Top element of the XML document representing the

    SOAP message

    SOAP header (optional)• Indications

    SOAP body (mandatory)• Container for mandatory information intended for SOAP

    receiver

  • 47

    SOAP Message Structure

  • 48

    SOAP RemarksWeb services to solve problems:

    Dynamic generated web contentEasy method for accessing online information

    SOAP is easily adopted and quickly developedSOAP won’t replace lower-level technologiesAvailable for Python, Java, Visual Basic, Perl, etc.Again, simplicity and extensibility.

  • 49

    OutlineIntroduction to Java technologyTrend of application frameworkThe XML serverXML support in Java technology spectrumNative XML databaseConclusion

  • 50

    What is Native XML Database?Defines a (logical) model for an XML document

    The database is specialized for storing XML dataHas an XML document as its fundamental unit of (logical) storage

    Documents in, documents outIs not required to have any particular underlying physical storage model

    May not actually be a standalone database at all

  • 51

    Native XML Database FeaturesXML storageCollections

    Allow you to query and manipulate those documents as a set

    QueriesXPath, XQL

    UpdatesUpdate portions of documents

  • 52

    Native XML Database ProductseXist: proprietary/relationalozone: object-orientedTamino: proprietary/relationalXindice: proprietaryX-Hive: object-oriented/relational

  • 53

    ConclusionJava technologyApplication frameworkXML serverJava support on XMLNative XML database

  • 54

    Questions?