1 / 55

Week 8

Week 8. EC Technologies: Building EC Applications on the Web, Client and Server Side Programming, Database Technologies, Data Interchange and XML, and Web Services. Learning Objectives. Introduce the main components of a Web site.

andrew
Télécharger la présentation

Week 8

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. Week 8 EC Technologies: Building EC Applications on the Web, Client and Server Side Programming, Database Technologies, Data Interchange and XML, and Web Services

  2. Learning Objectives • Introduce the main components of a Web site. • Describe the major EC applications and list their major functionalities. • Review briefly the relational database technologies. • Briefly review the methods for connecting to databases. • Introduce XML technologies • Discuss the value and technical foundation of Web Services in EC applications. • Understand service-oriented architecture (SOA) and its relationship to EC.

  3. Web Architecture SOURCE: INTERSHOP

  4. Website Components SQL Database HTTP request (cleartext or SSL) Firewall Web Client Web Server Web app DB Web app DB Web app Web app HTTP reply (HTML, Javascript, VBscript, etc) • Apache • IIS • Netscape • etc… • Plugins: • Perl • C/C++ • JSP, etc • Database connection: • ADO, • ODBC, etc. SOURCE: NTOBJECTIVES.COM

  5. Internet Client- and Server Side Programming Server Client HTML CGI/Perl, C Applets ASP ActiveX Controls Servlet Dynamic HTML JSP JavaScript PHP XML SOURCE: IIT

  6. Tiers and URLs URLs can be used for application routing http: // 10.0.0.1 / catalog / display.asp ? pg = 1 & product = 7 Web Server Web app DB Web app DB Web app Web app SOURCE: NTOBJECTIVES.COM

  7. The Major EC Applications and Their Functionalities • B2C Storefronts • Product presentation function • Order entry function • Electronic payment function • Order fulfillment function • Customer service function • Product support function

  8. The Major EC Applications and Their Functionalities • Supplier Sell-Side B2B Sites • Personalized catalogs and Web pages for all major buyers • A B2B payment gate • Electronic contract negotiation features • Product configuration by customers • Affiliate program capabilities • Business alerts (e.g., to special sales, to news)

  9. The Major EC Applications and Their Functionalities • E-Procurement • Aggregating Catalogs • Reverse Auctions and Tendering Systems • Forward Auctions • Exchanges • Portals • Other EC Systems

  10. Major Components of an EC Suite

  11. Relational Databases • A set of tables (relations, e.g., relations for course and faculty), each has a set of columns (attributes). • Primary keys and foreign keys. • Constraints: domain, entity (primary key), referential • Schema and instances FOREIGN KEY: PRIMARY KEY PRIMARY KEY

  12. Structured Query Language (SQL) • A data manipulation language for manipulating relational databases • SELECT queries the database • UPDATE modifies relations • DELETE removes tuples Syntax of the SQL SELECT command: SELECT { attributes }FROM { table }WHERE { attribute-conditions } GROUPBY { attributes }HAVING { attribute-conditions } ORDERBY { attributes }

  13. Structured Query Language (SQL) SELECT course, rm FROM course WHERE faculty = “SHAMOS” ORDERBY rm SELECT c.faculty, course, school, f.dept FROM course c, faculty f WHERE rm = 152 SELECT school, count(*) FROM course GROUPBY school HAVING count(*) > 5

  14. Embedded SQL • Programs written in embedded SQL consist of statements in a host language (e.g. C, Cobol, Pascal, etc.) and statements in SQL. SQL commands handle database access, and the host language commands implement procedural program logic. • Application development using embedded SQL is similar to the traditional programming environment. Programs must be pre-compiled, then compiled and linked before execution. • Important points • Interface between the two languages • Data type compatibility • Error detection • Handling of multiple record retrievals

  15. Embedded SQL Examples • Insert • EXEC SQL insert into • emp(empno, name, salary, comm, deptno) • value(:eno, :name, :salary, default, :dno) update EXEC SQL update emp set salary = salary + :raise where name = :name delete EXEC SQL delete from emp where name = :name

  16. Embedded SQL Examples • single row retrieval • EXEC SQL select sal • into :salary • from emp • where empno = ‘7756’ • multiple row retrieval • EXEC SQL declare cur_sal cursor for • select sal • from emp; • EXEC SQL open cur_sal; • loop: • EXEC SQL fetch cur_sal into :salary; • ...... • go to loop; • EXEC SQL close cur_sal;

  17. Cursor Operations 1. CURSOR DECLARATION A declarative step that specifies the query. 2. OPEN CURSOR STATEMENT Activates the cursor; the select statement is executed, and the active set of records for the cursor is identified. 3. PROCESSING OF THE ACTIVE SET Using the FETCH statement ('read next') the active set of records is processed sequentially. After the last record is read SQLCODE is set > 0 to indicate that the set is exhausted. 4. CLOSE CURSOR STATEMENT Deactivates the cursor.

  18. Database Design • Entity-Relationship model • Entities • Relationships • Attributes • Relational database design • Normalization via Functional Depedency/Multi-Valued Dependency (normal forms) • First conceptual modelling (E-R diagram), then mapping to relational database schema

  19. Transactions • A transaction is a logical unit of work, and is composed of operations (updates, deletes, and insertions) • ACID properties • Atomicity: all operations or none • Consistency: database is consistent after transaction completes, ie. all integrity constraints must be satisfied when multiple users operate concurrently on the same database • Isolation: partial results not revealed to other transactions • Durability: committed transactions cannot be undone • Concurrency control: guarantees CI • Recovery: guarantees AD

  20. Web Database Connectivity JDBC = Java Database Connectivity SQLJ = Java-Embedded SQL SOURCE: CONNOLLY & BEGG

  21. SQL*Net SQL*Net Net Soft Data Source ODBC Architecture Application Driver Manager DBMS Driver DBMS Driver Net Soft Oracle SQL Server Data Source

  22. ODBC Components • Application - calls ODBC functions • Driver Manager - dynamically loads drivers as needed • Driver • maps ODBC functions into native API • processes ODBC function calls • submits SQL requests to a specific data source • return results to the application • Data source - any source of data, eg. database, file system

  23. JDBC Database Coonectivity • JDBC uniform interface to a wide range of SQL databases • Java standard for embedded SQL calls • based on X/Open SQL CLI (as ODBC) • JDBC defines Java-SQL API • JDBC driver needed for access to a specific DBMS - can be downloaded dynamically • makes Java applications portable across different SQL databases

  24. XML Technologies • Tell what the data is • Tell how the data is structured • Tell how it should look • BUT DO THESE SEPARATELY. MIXING IS BAD • The meaning -- XML • The structure -- XML Schema (document type definition) • The formatting -- XSL (eXtensible style sheet language) • Example: XML catalog structure • DTD, XSL SO COMPUTERS CAN UNDERSTAND IT

  25. XML Documents… • All XML documents need to be • Well-formed, one root, no element overlapping, etc. • Valid against a Schema/DTD (Optional) • Parsers will check if document is well-formed • Validity checked if the document refers to a DTD or XML Schema • Validating parsers and Non-Validating parsers

  26. XML vs. HTML <TABLE> <TR> <TD>Thomas</TD><TD>Atkins</TD> </TR> <TR> <TD>age:</TD><TD>30</TD> </TR> </TABLE> HTML <Person> <Name> <First>Thomas</First> <Last>Atkins</Last> </Name> <Age>30</Age> </Person> XML

  27. Well-formedness Rules of well-formedness: • Document must follow “Document” production, i.e., document contains a prolog, a root element and a miscellaneous part to which the following rules apply • One root element containing all other elements • Elements must have both a start and end tag, except that empty elements end in “/>” • Elements do not overlap but can nest, e.g.: <section> <sectionName> …</sectionName> <ref> … </ref> </section>

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

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

  30. Structure of XML Documents <?xml version="1.0"?> <oldjoke name=“jk1” status=“funny”> <burns> Say <quote>goodnight</quote> ,Gracie. </burns> <allen> <quote>Goodnight,Gracie.</quote> </allen> <applause/> </oldjoke> • The example document can be validated using a DTD

  31. Document Type Definition (DTD) • Example of a DTD <!ELEMENT oldjoke (burns+, allen, applause?)> <!ELEMENT burns (#PCDATA | quote)*> <!ELEMENT allen    (#PCDATA | quote)*> <!ELEMENT quote    (#PCDATA)*> <!ELEMENT applause EMPTY> • Attributes can also be checked for <!ATTLIST oldjoke name ID #REQUIRED label CDATA  #IMPLIED status ( funny | notfunny ) 'funny'>

  32. XML Schema Definition (XSD) • Much more powerful than DTD • Defines the allowed tags and attributes • XSD is an XML language that : • defines elements that can appear in a document • defines attributes that can appear in an element • defines hierarchy and number of child elements • defines data types for elements and attributes • defines default and fixed values for elements and attributes

  33. An XSD File Root tag = schema <?xml version="1.0"?> <!-- XML Schema Example for eCommerce Technology --> <xs:schema xmlns:xs="http://www.cmu.edu/XMLschema" targetNamespace="http://www.cmu.edu" xmlns="http://www.cmu.edu" elementFormDefault="qualified"> <xs:element booklist> <xs:complexType> <xs:element name="textbook“ maxOccurs=“unbounded”> <xs:complexType> <xs:sequence> <xs:element name="title" type="xs:string"/> <xs:element name="author" type="xs:string"/> <xs:element name="ISBN" type="xs:string"/> <xs:element name="publishdate" type="xs:date"/> <xs:element name="price"> <xs:simpleType> <xs:restriction base="xs:integer"> <xs:minExclusive value="0"/> <xs:maxInclusive value="100"/> </xs:restriction> </xs:simpleType> </xs:element> </xs:sequence> </xs:complexType> </xs:element> </xs:complexType> </xs:element> </xs:schema> XSD Namespace Namespace being defined Local elements must specify a namespace Begin definition of element “textbook” subelements must occur in sequence “textbook” has subelements string element “author” string element “title” date element “publishdate” string element “ISBN” element “price” “price” must be an integer > 0 but not > 100

  34. Extensible Stylesheet Language (XSL) • XSL describes presentation of data • Three parts of XSL: • XSLT (language for transforming XML documents) • XPath (language for extracting parts of an XML document) • XSL Formatting Objects (vocabulary for formatting XML documents)

  35. XML Style SheetProcessor HTML Page XSL Style Sheet XML Style Sheet Processing SOURCE: SOFTWARE AG

  36. XSL Functions • Transform XML into other languages or formats • Filter and sort XML data • Extract parts of an XML document • Format XML data based on the data value (like displaying negative numbers in red) • Output XML data to different devices, like screen, paper or voice (SpeechML) SOURCE: CAMUS

  37. XPath Expressions • //order[3]/item[2] • (2nd “item” tag in 3rd “order” tag) • //purchase/item[id=508] • (Inside a “purchase” tag, any “item” tag with “id” subelement having value 508) • //payment[payment_header/@date=“2007-02-04” & currency=“HKD”] • (Any payment in Hong Kong dollars made on Feb 4, 2007) SOURCE: CAMUS

  38. XML and XSL <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="cdcatalog.xsl"?> <catalog> <cd> <title>Empire Burlesque</title> <artist>Bob Dylan</artist> <country>USA</country> <company>Columbia</company> <price>10.90</price> <year>1985</year> </cd> . . . </catalog>

  39. A Simple XSL file <?xml version="1.0" encoding="ISO-8859-1"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:template match="/"> <html> <body> <h2>My CD Collection</h2> <table border="1"> <tr bgcolor="#9acd32"> <th align="left">Title</th> <th align="left">Artist</th> </tr> <xsl:for-each select="catalog/cd"> <tr> <td><xsl:value-of select="title"/></td> <td><xsl:value-of select="artist"/></td> </tr> </xsl:for-each> </table> </body> </html> </xsl:template> </xsl:stylesheet>

  40. Docu-ment DTD Parser startDocument Application implementsDocumentHandler startElement startElement endElement DOM SAX endElement endDocument XML APIs – SAX and DOM SAX = Simple API for XML DOM = Document Object Model Document Tree SOURCE: SOFTWARE AG 1

  41. DOM Methods for Navigation parentNode previousSibling nextSibling firstChild lastChild childNodes(length, item()) getElementsByTagName SOURCE: SOFTWARE AG

  42. XMLDOMDocument XMLDOMNode XML Document Tree Element Attribute Value Document CATALOG WIDGET WIDGET ID ID 1 2 NAME PRICE NAME PRICE CURRENCY CURRENCY Widget 1 10 20 Widget 2 USD USD SOURCE: MICROSOFT

  43. Financial XML “Implementations” • (Financial Products Markup Language) • FIXML (FInancial eXchange ML) • (FINancial XML) • FSML (Financial Services ML) • (Straight-Through Processing ML) • (SWIFT ML)

  44. eBusiness XML • ebXML (eBusiness XML) • eCX (eCatalog XML) • Tracker XML (for import/export) • tXML (Transportation XML, for logistics) • (VISA XML Invoice Specification) • (eXtensible Business Reporting Language)

  45. Web Services, and Service-Oriented Architecture • The Need for Integration • Platform-specific objects • Dynamic environment • Security barriers • The Roles of XML and Web Services Web service A software system identified by a URI (uniform resource indicator), whose public interfaces and bindings are defined and described using XML

  46. Web Services, and Service-Oriented Architecture • Web Services Web Services are self-contained, self-describing business and consumer modular applications, delivered over the Internet, that users can select and combine through almost any device, ranging from personal computers to mobile phones

  47. Web Services, and Service-Oriented Architecture • Key Technologies in Web Services Simple Object Access Protocol (SOAP) Protocol or message framework for exchanging XML data across the Internet Web Services Description Language (WSDL) An XML document that defines the programmatic interface—operations, methods, and parameters—for Web Services

  48. Web Services, and Service-Oriented Architecture • Key Technologies in Web Services universal description, discovery, and integration (UDDI) An XML framework for businesses to publish and find Web Services online security protocol A communications protocol that encrypts and decrypts a message for online transmission; security protocols generally provide authentication

  49. Key Components of Web Services

  50. Web Services, and Service-Oriented Architecture • Web Services Platforms • Microsoft .NET • IBM WebSphere • J2EE Architecture

More Related