e Commerce Technology 20 751 Lecture 5 Data

  • Slides: 32
Download presentation
e. Commerce Technology 20 -751 Lecture 5: Data Interchange

e. Commerce Technology 20 -751 Lecture 5: Data Interchange

Outline • The need for data interchange – Transactions imply data exchange • XML

Outline • The need for data interchange – Transactions imply data exchange • XML for identifying data – Separation of • content • appearance • document structure • Integrating with legacy applications – Legacy application: one you wish you could replace but can’t • ASN. 1 for self-describing data formats – Solves a different problem than XML does – Not what the data means but how it is encoded 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

e. Commerce Data Exchange Needs RFQs Ship Notices Catalogs Letters of Credit Quotations Purchase

e. Commerce Data Exchange Needs RFQs Ship Notices Catalogs Letters of Credit Quotations Purchase Orders Electronic Payments Bills of Lading Invoices 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

Invoice Example <Unit. Price>6. 05</Unit. Price> SOURCE: PROF. JEROME YEN 20 -751 ECOMMERCE TECHNOLOGY

Invoice Example <Unit. Price>6. 05</Unit. Price> SOURCE: PROF. JEROME YEN 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

Data Exchange Problem Different systems and applications use different names and formats for the

Data Exchange Problem Different systems and applications use different names and formats for the same information: SOURCE: FTISOFT

How to Make Data Portable • Tell what the data means • Tell how

How to Make Data Portable • Tell what the data means • Tell how the data is structured • Tell how it should look SO COMPUTERS CAN UNDERSTAND IT • BUT DO THESE SEPARATELY • • The meaning -- XML The structure -- DTD (document type definition) The formatting -- XSL (Extensible style sheet) Example: XML catalog structure

Content and Format Information conveyed in 2 ways: • words, pictures and other information

Content and Format Information conveyed in 2 ways: • words, pictures and other information (content) • visual clues font, font size and location (format) SOURCE: RACHEL SOKOLOWSKI 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

XML Example <? XML version="1. 0" ? > <PRESCRIPTION> <MEDNAME MED="Amoxil"> Prescribed medication: Amoxil</MEDNAME>

XML Example <? XML version="1. 0" ? > <PRESCRIPTION> <MEDNAME MED="Amoxil"> Prescribed medication: Amoxil</MEDNAME> <FORM TYPE="capsule"> Form: capsule </FORM> <DOSAGE AMOUNT="25 mg"> Dosage: 25 mg</DOSAGE> <RXINSTRUCTIONS FREQUENCY="daily"> daily </RXINSTRUCTIONS> </PRESCRIPTION> SOURCE: RACHEL SOKOLOWSKI 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

XML at a glance Well Formed Document: <Book> <Author>George Soros</Author> <Title>The Crisis of Global

XML at a glance Well Formed Document: <Book> <Author>George Soros</Author> <Title>The Crisis of Global Capitalism</Title> <Year>1998</Year> <Publ>Public Affairs</Publ> <Price>26. 00</Price> <ISBN>1 -891620 -27 -4</ISBN> </Book> DTD: Document Type Definition <? xml version="1. 0"> <!DOCTYPE Book [ <!ELEMENT Book (Author, Title, Year, Publ, Price, ISBN)> ]> SOURCE: PROF. JEROME YEN 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

XML Recipe Example <? xml version="1. 0"? > <Recipe> <Name>Apple Pie</Name> <Ingredients> <Ingredient> <Qty

XML Recipe Example <? xml version="1. 0"? > <Recipe> <Name>Apple Pie</Name> <Ingredients> <Ingredient> <Qty unit=pint>1</Qty> <Item>milk</Item> </Ingredient> <Qty unit=each>10</Qty> <Item>apples</Item> </Ingredients> <Instructions> <Step>Peel the apples</Step> <Step>Pour the milk into a 10 -inch saucepan</Step> <!-- And so on. . . --> </Instructions> </Recipe>

Document Is Now Block-Structured <? xml version="1. 0"? > <Recipe> <Name>Apple Pie</Name> <Ingredients> <Ingredient>

Document Is Now Block-Structured <? xml version="1. 0"? > <Recipe> <Name>Apple Pie</Name> <Ingredients> <Ingredient> <Qty unit=pint>1</Qty> <Item>milk</Item> </Ingredient> <Qty unit=each>10</Qty> <Item>apples</Item> </Ingredients> <Instructions> <Step>Peel the apples</Step> <Step>Pour the milk into a 10 -inch saucepan</Step> <!-- And so on. . . --> </Instructions> </Recipe>

DTD (Document Type Definition) XML is extensible because it allows user-defined tags DEFINES TAG

DTD (Document Type Definition) XML is extensible because it allows user-defined tags DEFINES TAG Recipe HAVING A Name AND 3 OPTIONALTAGS XML COMMENT <!-- Sample DTD --> <!ELEMENT Recipe (Name, Description? , Ingredients? , TAGS Name, Description Instructions? )> CONTAIN ONLY <!ELEMENT Name (#PCDATA)> CHARACTER DATA <!ELEMENT Description (#PCDATA)> TAG Ingredients CONTAINS ZERO OR <!ELEMENT Ingredients (Ingredient)*> MORE Ingredient TAGS <!ELEMENT Ingredient (Qty, Item)> Ingredient TAG HAS A <!ELEMENT Qty (#PCDATA)> Qty TAG FOLLOWED <!ATTLIST Qty unit CDATA #REQUIRED> BY AN Item TAG <!ELEMENT Item (#PCDATA)> TAG Qty HAS TWO <!ATTLIST Item optional CDATA "0" POSSIBLE ATTRIBUTES: optional (DEFAULT VALUE 0) is. Vegetarian CDATA "true"> is. Vegetarian (DEFAULT true) <!ELEMENT Instructions (Step)+> SOURCE: JAVAWORLD TAG Instructions HAS ONE OR MORE Step TAGS

Document Object Model (DOM) in XML • An XML structured document can be treated

Document Object Model (DOM) in XML • An XML structured document can be treated and manipulated as an object • DOM parser transforms the document into a parse tree • Program can walk the tree, performing arbitrary transformations • DOM API then converts the new tree to another XML file • New file can be printed, sent over the net or used as input to another program • Applications can now exchange data without knowing formats — DTD contains everything necessary SOURCE: JAVAWORLD

XML Financial Implementations • OFX - Open Financial Exchange – Fields • FIXML -

XML Financial Implementations • OFX - Open Financial Exchange – Fields • FIXML - XML grammar for FIX (Financial Information Exchange). MSDW is a principal. More information • FINXML - Capital markets. Info. Vendor: Integral • SWIFT • X 12 - data exchange standard for business transactions SOURCE: PROF. JEROME YEN 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

XML Implementations • HL 7 - health information (Health Level 7) • EDIFACT/Simpl. EDI

XML Implementations • HL 7 - health information (Health Level 7) • EDIFACT/Simpl. EDI - syntax - repository • IFX - Interactive Financial Exchange formerly OFX/Gold (Open Financial Exchange ) - personal banking. • Rosetta. Net - catalogues, supply chain automation • OTP - Open Trading Protocol - buying and payments • Financial markup standards • XML-enabled product vendor list • ECML - Electronic Commerce Markup Language – Field names 20 -751 ECOMMERCE TECHNOLOGY SOURCE: PROF. JEROME YEN SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

Ubiquitous XML Architecture SOURCE: PROF. JEROME YEN 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT

Ubiquitous XML Architecture SOURCE: PROF. JEROME YEN 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

Impact of XML • • • Interchange mechanism between applications Rapidly becoming the database

Impact of XML • • • Interchange mechanism between applications Rapidly becoming the database language of the Web XML client/server transactions over http: Permits web data repositories XML properties: – Scalable – Maintainable – Easy to use (spreadsheet style skills) – Interoperable (exchange business components) 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

Connecting to Legacy Systems by “Wrapping” “WRAPPER” Web Server Web App 20 -751 ECOMMERCE

Connecting to Legacy Systems by “Wrapping” “WRAPPER” Web Server Web App 20 -751 ECOMMERCE TECHNOLOGY MAINFRAME Wrapper Middleware SUMMER 2000 Legacy App COPYRIGHT © 2000 MICHAEL I. SHAMOS

Connecting to Legacy Systems The “screen scraper” HTML data Terminal screen data Screen scraper

Connecting to Legacy Systems The “screen scraper” HTML data Terminal screen data Screen scraper Client Legacy system (mainframe) Existing application Legacy database Web server SOURCE: WIM GEVERS 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

Standard Encodings • Business systems must exchange data in different formats: – Invoices, payment

Standard Encodings • Business systems must exchange data in different formats: – Invoices, payment orders, checks, bills of lading, delivery instructions, authentication information • Need standard notation to describe transmitted data in communication protocols • BUT: what format is the data in? – What does 437573746 F 6 D 6572 (hex) mean? – Where do fields begin and end? – How about complex data structures (arrays, etc, )?

Need for Standard Encodings • Interoperability – How can my program read your program’s

Need for Standard Encodings • Interoperability – How can my program read your program’s data? • Parties cannot always agree in advance on standards • Encodings need to be changed – YYMMDD became YYYYMMDD (the Y 2 K problem) • Minimize programmer and development time

Abstract Syntax Notation (ASN) • ASN. 1 is a method of encoding data so

Abstract Syntax Notation (ASN) • ASN. 1 is a method of encoding data so that the format can be decoded from the data itself • ASN. 1 is not a programming language • It describes only data structures. No code, no logic.

Abstract Syntax Notation • ASN. 1 has primitive types: BOOLEAN, INTEGER, REAL, ENUMERATED, BIT

Abstract Syntax Notation • ASN. 1 has primitive types: BOOLEAN, INTEGER, REAL, ENUMERATED, BIT STRING, OCTET STRING, IA 5 STRING, . . . • ASN. 1 has – SET (unordered) SEQUENCE (fixed order) of primitive types – CHOICE for selecting alternative types (integer or real) • Can define new types: Month : : = INTEGER (1. . 12) Day : : = INTEGER (1. . 31) Daily-stock-volume : : = SEQUENCE SIZE (31) OF INTEGER

Basic Encoding Rules (BER) • Define how fields described in ASN. 1 should be

Basic Encoding Rules (BER) • Define how fields described in ASN. 1 should be encoded • Units of BER are data elements • A data element is a triple: { identifier-type, length, value } • Some type codes: BOOLEAN IA 5 STRING INTEGER SEQUENCE SET 01 16 02 10 31 (8 -BIT ASCII) • The string “Customer” would be encoded as 16 08 43 75 73 74 6 F 6 D 65 72 IA 5 STRING LENGTH 8 20 -751 ECOMMERCE TECHNOLOGY HEX “C” HEX “r” HEX “u” SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

Basic Encoding Rules • Content field may be primitive (value) or structured (content has

Basic Encoding Rules • Content field may be primitive (value) or structured (content has subcomponents) 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

Basic Encoding Rules • Content field may be primitive (value) or structured (content has

Basic Encoding Rules • Content field may be primitive (value) or structured (content has subcomponents) Person : : = SET { name IA 5 String, age INTEGER female BOOLEAN }. BER encoding (in hex) of the instance {“Maggie”, 4, TRUE}: SET 31 0 E LENGTH OF CONTENT (BYTES) 16 06 CODE FOR IA 5 STRING 20 -751 ECOMMERCE TECHNOLOGY M a g g i e 4 D 41 E 7 69 65 LENGTH OF “Maggie” DATA 02 CODE FOR I NTEGER SUMMER 2000 01 LENGTH OF INTEGER 4 04 01 CODE FOR BOOLEAN TRUE 01 FF LENGTH OF BOOLEAN COPYRIGHT © 2000 MICHAEL I. SHAMOS

Using ASN. 1/BER ASN. 1 DEFINITIONS ASN. 1 COMPILER SOURCE LANGUAGE (JAVA, C) DATA

Using ASN. 1/BER ASN. 1 DEFINITIONS ASN. 1 COMPILER SOURCE LANGUAGE (JAVA, C) DATA STRUCTURES ENCODER/ DECODER APPLICATION CODE APPLICATION PROGRAM (JAVA, C) COMPILER APPLICATION PROGRAM NOW READS AND WRITES DATA ACCORDING TO BER 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 APPLICATION PROGRAM COPYRIGHT © 2000 MICHAEL I. SHAMOS

Applications of ASN. 1 • • • Automatic Identification and Data Capture Air traffic

Applications of ASN. 1 • • • Automatic Identification and Data Capture Air traffic control Telephone communications Electronic payment protocols (e. g. SET) Digital certificates Manufacturing message specification (MMS) for controlling manufacturing devices 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

Automatic Identification and Data Capture (AIDC) • Problem: how to obtain data from physical

Automatic Identification and Data Capture (AIDC) • Problem: how to obtain data from physical objects – Examples: product ID, price, serial number • Bar code two-dimensional • • Magnetic stripe card RFID CIRCUIT Smart card Radio Frequency Identification (RFID) Real-Time Locating Systems (RTLS) TAG WAND READER 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

AIDC Applications • • Highway toll collection Freight containers Animal identification Theft detection Inventory,

AIDC Applications • • Highway toll collection Freight containers Animal identification Theft detection Inventory, asset management Traffic control Gas station billing SOURCE: TSS 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

AIDC Applications • • • Highway toll collection Freight containers Animal identification Inventory, asset

AIDC Applications • • • Highway toll collection Freight containers Animal identification Inventory, asset management Traffic control 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

Q&A 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS

Q&A 20 -751 ECOMMERCE TECHNOLOGY SUMMER 2000 COPYRIGHT © 2000 MICHAEL I. SHAMOS