week 8 n.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Week 8 PowerPoint Presentation
Download Presentation
Week 8

Loading in 2 Seconds...

play fullscreen
1 / 55

Week 8 - PowerPoint PPT Presentation


  • 443 Views
  • Uploaded on

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.

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Week 8' - andrew


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.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
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
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.
web architecture
Web Architecture

SOURCE: INTERSHOP

website components
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

client and server side programming

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

tiers and urls
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

the major ec applications and their functionalities
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
the major ec applications and their functionalities1
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)
the major ec applications and their functionalities2
The Major EC Applications and Their Functionalities
  • E-Procurement
    • Aggregating Catalogs
    • Reverse Auctions and Tendering Systems
    • Forward Auctions
    • Exchanges
    • Portals
    • Other EC Systems
relational databases
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

structured query language sql
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 }

structured query language sql1
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

embedded sql
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
embedded sql examples
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

embedded sql examples1
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;
cursor operations
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.

database design
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
transactions
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
web database connectivity
Web Database Connectivity

JDBC = Java Database Connectivity

SQLJ = Java-Embedded

SQL

SOURCE: CONNOLLY & BEGG

odbc architecture

SQL*Net

SQL*Net

Net Soft

Data

Source

ODBC Architecture

Application

Driver Manager

DBMS

Driver

DBMS

Driver

Net Soft

Oracle

SQL Server

Data

Source

odbc components
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
jdbc database coonectivity
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
xml technologies
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

xml documents
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
xml vs html
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

well formedness
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>

recipe xml example
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>

document is tree structured
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>

structure of xml documents
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
document type definition dtd
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'>

xml schema definition xsd
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
an xsd file
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

extensible stylesheet language xsl
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)
xml style sheet processing

XML

Style SheetProcessor

HTML Page

XSL Style Sheet

XML Style Sheet Processing

SOURCE: SOFTWARE AG

xsl functions
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

xpath expressions
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

xml and xsl
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>

a simple xsl file
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>

xml apis sax and dom

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

dom methods for navigation
DOM Methods for Navigation

parentNode

previousSibling

nextSibling

firstChild

lastChild

childNodes(length, item())

getElementsByTagName

SOURCE: SOFTWARE AG

xml document tree

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

financial xml implementations
Financial XML “Implementations”
  • (Financial Products Markup Language)
  • FIXML (FInancial eXchange ML)
  • (FINancial XML)
  • FSML (Financial Services ML)
  • (Straight-Through Processing ML)
  • (SWIFT ML)
ebusiness xml
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)
web services and service oriented architecture
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

web services and service oriented architecture1
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

web services and service oriented architecture2
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

web services and service oriented architecture3
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

web services and service oriented architecture4
Web Services, and Service-Oriented Architecture
  • Web Services Platforms
    • Microsoft .NET
    • IBM WebSphere
    • J2EE Architecture
web services and service oriented architecture5
Web Services, and Service-Oriented Architecture
  • The Notion of Web Services as Components
    • Web Services enable the Web to become a platform for applying business services as components in IT applications
    • Web Services offer a fresh approach to integration
    • Business processes that are comprised of Web Services are easy to adapt to changing customer needs and business climates
web services and service oriented architecture6
Web Services, and Service-Oriented Architecture
  • A Web Services Example
    • Consider an airline Web site that provides consumers with the opportunity to purchase tickets online
      • The airline recognizes that customers also might want to rent a car and reserve a hotel as part of their travel plans
      • The consumer would like the convenience of logging onto only one system rather than three, saving time and effort
      • Also, the same consumer would like to input personal information only once
web services and service oriented architecture7
Web Services, and Service-Oriented Architecture
  • Advantages of Web Services
    • Rely on universal, open, text-based standards that greatly simplify the problems posed by interoperability and that lower the IT costs
    • Enable software running on different platforms to communicate, reducing the cost and headaches of multiple platforms
    • Promote modular programming, which enables reuse by multiple organizations
    • Are easy and inexpensive to implement because they operate on the existing Internet infrastructure. They also offer a way to maintain and integrate legacy IT systems at a lower cost than typical EAI efforts
    • Web Services can be implemented incrementally
web services and service oriented architecture8
Web Services, and Service-Oriented Architecture

Service-Oriented Architecture (SOA)

An application architecture in which executable components, such as Web Services, can be invoked and executed by client programs based on business rules

  • Transport
  • Description
  • Discovery
  • Registration