Java and XML

1 / 61
About This Presentation
Title:

Java and XML

Description:

Customer Loyalty Cards. Discount : Group / Volume. Coupons. Taxes. History of Purchases (10th meal free) Specials and Promotions. XML Design Patterns ... – PowerPoint PPT presentation

Number of Views:44
Avg rating:3.0/5.0
Slides: 62
Provided by: ronaldk7

less

Transcript and Presenter's Notes

Title: Java and XML


1
Java and XML
  • History Java Background
  • Java on the Server
  • XML Overview
  • Java and XML
  • Sample XML Standard - SIF
  • Ron Kleinman
  • Chief Technical Evangelist
  • Sun Developer Relations

2
Java History
  • To understand the Present, it is necessary to
    understand the past.

3
Java The Revolution
4
Browsing in the Early Days (BJ)
Browser
Web Server
URL
HTML Data (Picture, Sound Form, URL)
5
Java Its an HTML Data Type
  • Executable HTML data type Applet
  • Stored on Server
  • Executed on Client Browser
  • Implications
  • Platform Independent
  • Revolution in Software Distribution

6
Java Its a Language
  • Language Requirements
  • Secure
  • Powerful
  • Robust
  • Network Ready
  • Language for Distributed Applications

7
Java Write Once, Run Everywhere
Compiled
Java Byte Code
Java Applet
Web Server
Jar File
URL
Java Virtual Machine Native OS calls
JIT Compiled
Native Binary Native OS calls
8
Java Its a Desktop Client Platform
  • Java code executes anywhere JVM exists
  • Browser
  • Operating System
  • Chip
  • Implications
  • Write it once, Run it anywhere
  • The language itself is the platform!

9
Evolution of Java
Enterprise Server Platform
HTML Data Type
Desktop Client Platform
Client Countertop (ATM/kiosk/POS)
Programming Language
Embedded Devices (Jini)
1995
1997
1999
10
Java on the Server
  • Platform and Middleware Independence at the heart
    of the Enterprise

11
Java Its a Server Platform
  • Extend existing Java Platform Functionality
  • Hardware OS Independence
  • Application Robustness
  • Baked-In Security
  • Multi-CPU Support
  • Add Server-Specific Functionality
  • Access to Legacy Infrastructures
  • 100 Pure Java APIs
  • Write it once, Run it Anywhere
  • Integrate it with everything

12
2 Tier Architecture
Problem Business Logic Changes
Client
Web Server
SQL
Data
GUI Verification Business Logic
13
3 Tier Client Centric
Business Logic Shared
Web Server
Business Logic
URL
Fat Client
Active X Control
RDBMS
SQL
GUI Verification Business Logic
Data
14
3 Tier Network Centric
URL
Thin Client
Application Server
RDBMS
SQL
Applet
Request
Response
Data
  • GUI / Verification / Business Logic Shared
  • Separation of Client and RDBMS
  • Security of Data
  • Clients outside Firewall
  • Client Request ? Multiple Databases
  • Sharing of DB Connections ? Performance win /
    Scaling

15
Server Platform Infrastructures
  • Naming and Directory Service (JNDI)
  • Relational Database Access (JDBC)
  • Transaction Processing (JTS/JTA)
  • Distributed Objects (JavaIDL)
  • Message Queuing Events (JMS)
  • Security ()
  • Server Components (Servlets EJBs)

16
Generic Java Service Infrastructure
Java Server-side Application
Infrastructure-Specific API
Infrastructure Support Classes (JDK)
Infrastructure-Specific SPI
Proprietary Product Client
Proprietary Product Server
17
Java Naming and Directory (JNDI)
Java Application
JNDI API (Tree)
Write Once Run Anywhere Integrate with Everything
JNDI Implementation Manager
JNDI SPI
LDAP
DNS
NDS
NIS
Clients
LDAP
DNS
NDS
NIS
Servers
18
Java Database Connectivity (JDBC)
Java Application
Write Once Run Everywhere Access Everything
JDBC
ODBC Bridge
Vendor Supplied Driver
ODBC Driver
ODBC Converter
Native DB Client API
RDBMS
19
Java Distributed Objects (JavaIDL)
IDL Specification
Corba Client
IDL Stubs
IDL Skeleton
Corba Service
Legacy Infra- Structure
IIOP
ORB
ORB
Application Service
Infrastructure Service
20
Java Transaction Service (JTS/JTA)
  • Java ?? Object Transaction Services (OTS)
  • OTM (Iona)
  • TP Broker (Visigenic)
  • CORBAplus (Expersoft)
  • Alternative Java Transaction Capability
  • JavaJolt (BEA Systems) ? Tuxedo TP Monitor
  • JavaCICS (IBM) ? CICS

21
Java Message Service (JMS)
  • Alternative Java Messaging Capabilities
  • XIPC (Momentum)
  • Rendezvous (TIBCO)
  • Ambrosia (Open Horizon)
  • /Q (Bea)
  • MQ Series (IBM)
  • NEONet (New Era of Networks)
  • Pipes (PeerLogic)
  • VCOM (Verimation)
  • Middleware is Transparent!

22
Java Security
  • Security Components
  • Authentication
  • Authorization
  • Encryption
  • Java APIs
  • Java Card
  • Java Digital Signature
  • Java Cryptography

23
Java Web Server Components
Web Server
Browser
Servlet 1
Servlet 3
Servlet 2
Applet 1
Applet 3
Applet 2
Applet ?? Browser as Servlet ? ?
Web Server
24
Java Application Server Components
IDL Corba Skeleton
Security
Client
Container
Transactions
Legacy Service
Multi- Threading
EJB
Database
Messaging
Client
Naming Directory
Lifecycle
State Management
Client
Persistence
25
Language vs. OS Platform
26
Conclusions
  • Java Platform span all OS Platforms
  • Java Platform scales from embedded device to DB
    Server
  • Java Platform provides a SINGLE interface to each
    legacy infrastructure within enterprise

27
XML Overview
  • How a Simplified Document Markup Language
    revolutionized B2B communication

28
HTML vs. XML
  • HTML Presentation
  • John Jones 1234
  • XML Interpretation
  • John
  • Jones
  • Mr.
  • 1234

29
XML Highlights
  • Message Schema Language
  • Document Type Definition (DTD)
  • XML Schema
  • Message Parsers
  • SAX (Series of Events)
  • DOM (Object)
  • Message Verification
  • Well formed
  • Valid

30
Heterogeneous Interoperability
Sender
Java On Solaris
DOM Parser
XML / HTTP
SAX Parser
C On Windows
Receiver
31
Java and XML
  • A Marriage made in Developer Heaven

32
Java Platform and XML
  • JAXP Parsers
  • Java Data Binding (XML ?? Object)
  • XSLT support
  • New ebXML Messaging Hooks
  • Message-driven EJBs
  • Interoperate across platforms
  • with a platform neutral application

33
JAXP
  • Java APIs for XML Parsing
  • DOM
  • SAX
  • Free Reference Implementation
  • Free Binary Redistribution
  • Available now

34
SAX Simple API for XML
XML
SAX Parser
Event Handler
Events
Document
00342
public void startElement (String
namespace, String tag, String val, Attributes
atts) if (tag.equals (Form)) if
((atts.getValue (type).equals (Req))
String formNumber val
Sequential Read (good for layered XML)
35
DOM Document Object Model
  • Reads entire XML message
  • Creates tree of element nodes
  • Random R/W Seek any tag / change value
  • Relative Positioning next/last/child/parent

NodeList form elem.getElementsByTagName
(Form) If (form.getAttributes (type).equals
(Req)) String formNumber form.getValue
()
36
XML Data Binding
1. What arrives on / goes out over the line

John J.
Jones
37
XML Data Binding
2. What the programmer actually sees
public class Student public Student (int
id, Name name) public int getId () public
void setId (int) public Name getName ()
public void setName (Name) public void
marshal (OutputStream) throws IOException
public static Student unmarshal
(InputStream) throws IOException
38
XML Data Binding
3. Converting between Object and XML
public void acceptStudent (Socket s) throws
IOException Student st Student.unmarshal
(s.getInputStream ()) public void sendStudent
(Student st, socket s)
throws IOException st.marshal(s.getOutputStr
eam())
39
XML Data Binding
  • Programmer is aware of Java Objects only
  • Marshal/Unmarshal routines auto-validate
  • Status In progress (for DTDs)

DTD
XML Data
Object
Dom Parser
Classifier
Java Prog
40
Message-driven EJBs
  • One per defined topic
  • Maintains Durable Queue for offline clients
  • Guaranteed delivery
  • New Bean thread fired at each message arrival
  • Client does NOT need Bean Interface
  • Ideally suited for XML message processing

41
Vertical XML Standards
  • Interoperability through Document Exchange

42
XML Message Layers
XML Document
XML Header
XML Envelope

Transport
43
XML Infrastructure Features
  • Guaranteed Error-free Sequential Delivery
  • Disconnected Operation
  • Session Control
  • Versioning
  • Message Timestamps
  • Session Support / Transaction Support
  • Request / Response Matching
  • Publish / Subscribe Asynchronous Events
  • Security (Encryption, Authentication,
    Authorization)

44
1. XML Document
  • Industry Specific
  • Object pass by value
  • Schema defined by subcommittee
  • Common Data Elements (Ex Currency, Name)
  • Document Specific Elements (Ex Guest, Traveler,
    Patient, Student)

45
2. XML Header
  • Provides Context
  • Session Setup / Shutdown
  • Request / Response
  • Publish / Subscribe /Provide
  • Asynchronous Event
  • Only Response and Events have Document data

46
3. XML Envelope
  • Standard services for all messages
  • To/From addressing
  • Security
  • Message Identification
  • Timestamps

47
4. Transport
  • Selection
  • Administrative
  • Dynamic
  • Reference Transport Usage
  • HTTP / HTTPS
  • SMTP
  • MQ/Series / MSMQ

48
XML Document Business Logic
  • Rules or Results Dynamic
  • (Ex Price Lookup)
  • Customer Loyalty Cards
  • Discount Group / Volume
  • Coupons
  • Taxes
  • History of Purchases (10th meal free)
  • Specials and Promotions

49
XML Design Patterns
  • Dont transfer Business Rules
  • Price vs. how to calculate Price
  • Dont define what data can be returned
  • Use Event (Create/Update/Delete)
  • Define generic SQL Request Message
  • Response is specific to request, not to standard
  • Use a 3rd party broker

50
3rd Party Broker
App 1
Broker
App 2
  • How is Session established?
  • Direct to Partner vs. via 3rd Party (Broker)
  • Request / Response
  • How does requester find responder
  • Update Events
  • Who accepts Publisher/Subscriber registration?
  • Who multiplexes asynchronous events?
  • Who supplies persistence for disconnected op?

51
Infrastructure Buy not Make
  • SOAP
  • XML RPC
  • Crosses firewalls on HTTP Port 80
  • Good news and bad news
  • ebXML
  • Provides Envelope capabilities
  • Source, Destination, Message Ids
  • Packaging (XML as Mime data type)

52
Industry-specific XML Standards
53
HitisX
  • Initially UML Specification
  • Method call Request/Response
  • Security Password
  • Transport HTTP recommended (Admin)
  • Status Out for review
  • http//www.ahma.com

54
Open Travel Alliance (OTA)
  • Initially Distributed Database
  • Remote CRUD / partial record locks
  • B2B Strong Security
  • Multi-credentials
  • Status Available for review
  • http//www.ota.com

55
IxRetail
  • Initially ARTS Data Model
  • Merger with Active Store (Business Rules)
  • Maps entire retail enterprise (ASPs)
  • Starting with Price Lookup

56
School Interoperability Framework (SIF)
  • No Educational Application
  • is an Island
  • http//www.siia.net

57
Problem Isolated Applications
Library
Student Info
Xportation
DB
DB
DB
  • Multiple Data Entry
  • Inconsistent Data

58
Solution Shared Data Facility
Library
Student Info
Shared Data Facility
DB
DB
  • One Consistent Copy of Data
  • Any updates available to all
  • but legacy applications arent written that
    way!

59
School Interoperability Framework (SIF)
  • Standardize the way applications share data
  • Maintain own internal data
  • Publish data changes to interested applications
  • Subscribe to changes from other publishers
  • Dont tell an application what data it wants
  • Provide it a framework to get what it needs

60
Library
DB
DB
Shared Data Facility (ZIS)
Agent 2
Student Info
Agent 1
  • Enter the Agent and ZIS
  • Shared Data Facility is Zone Integration Server
    (ZIS)
  • Agent Isolates Application from ZIS
  • Agent / Application Interface is Open
  • Topology Independent (LAN, WAN, Internet)

61
What is the SIF Standard?
Library
DB
DB
SIF
SIF
Agent 2
Student Info
Agent 1
ZIS
  • SIF defines Agent / ZIS Message Exchanges
  • Creates a platform neutral wire
  • Wire carries XML Data / Transport (ex HTTPS)
Write a Comment
User Comments (0)