Distributed Application Services and Ebusiness Part II - PowerPoint PPT Presentation

1 / 27
About This Presentation
Title:

Distributed Application Services and Ebusiness Part II

Description:

entities are used to represent these special characters. ... (MS Word) SAX. PDF. Output. Other. Markup. Languages. WML. Scalable. Vector. Graphics (SVG) RDF, ... – PowerPoint PPT presentation

Number of Views:11
Avg rating:3.0/5.0
Slides: 28
Provided by: profatale
Category:

less

Transcript and Presenter's Notes

Title: Distributed Application Services and Ebusiness Part II


1
Distributed Application Services and E-business
Part II
2
So far
  • E-business
  • Definitions, E-business Models
  • E-business Patterns
  • Systems requirements
  • E-business drivers for Multi-tier Applications
    Architecture
  • Emerging web development technologies
  • Thin versus Thick Clients, and Thin server vs
    Thick server
  • In this session .
  • A brief introduction to Java
  • Brief introduction to Java
  • Overview of XML
  • Web applications using Java and XML
  • An example web application services
  • Tutorial session

3
What is Java?
  • Java language and environment
  • Born on May 23rd 1995.
  • Grew out of a product called Oak
  • Oak was designed for embedded software and
    consumer devices.
  • See http//www.javasoft.com
  • Java is an environment is
  • Ideal environment for writing object-oriented,
    distributed and platform independent
    applications, real-time, etc.
  • Java has a lot in common with C and C
  • Versions and editions

4
The Java timeline
5
How does it work?
  • A Java program is compiled into bytecodes
  • These bytecodes are interpreted by a JVM
  • The JVM converts these instructions into
    appropriate machine code
  • The program executes on the machine
  • Each platform therefore needs its own JVM
  • Enabling WORA -- Write Once, Run Anywhere
  • Java Virtual Machine
  • An imaginary machine that is implemented by
    emulating it in software on a real machine.
  • It specifies Instruction set, register set,
    class file format, stack, garbage collection,
    memory area
  • A JVM exists for various operating systems
    including
  • Windows 95/98/NT/2000, Solaris, Macintosh, OS/2,
    Linux, OS/400, OS/390, HPUX, AIX, IRIX, EPOC,
    Windows CE, PlamOS, etc.

6
Java Runtime Environment
7
Running Java Programs
  • A Java application is a stand-alone program that
    can use all of the features of the Java language
    environment
  • A Java applet is a restricted Java application
    that is designed to be run inside a Java-enabled
    web browser
  • Security restrictions
  • Applets have a different lifecycle to
    applications
  • A Java servlet is the equivalent of an applet,
    which is executed at server-side
  • It is a Java application that is designed to be
    run inside a Http servers

8
Examples Java Programme
  •  / Comments here Example of authenticator
    class /
  • package test 
  • import java.util.
  • import java.security. 
  • import com.server.http. 
  • public class TestAuthenticator extends
    AbstractAuthenticator
  • public void init(CauchoApplication app,
    RegistryNode params)  
  • public Principal authenticateCookie(String
    cookieValue) return null  
  • public Principal authenticate(String user, String
    password)
  • if (password ! null password.equals("quidditc
    h")) return new BasicPrincipal(user)
  • else return null  
  • public boolean updateCookie(Principal user,
    String cookieValue)
  • return true  
  • public boolean isUserInRole(Principal user,
    String role)
  • return user ! null "user".equals(role) 

9
Java 2 Enterprise Edition
  • Enterprise JavaBeansTM Architecture
  • Defines an API to enable developers to create,
    deploy and manage cross-platform, component-based
    enterprise applications.
  • JavaServer PagesTM
  • Enables rapid development of server-side
    web-based applications, such as dynamic web
    content management.
  • JavaTM Servlet
  • Java Naming and Directory InterfaceTM (JNDI)
  • JavaTM Message Service (JMS)
  • Provides a standard Java API for enterprise
    messaging services such as reliable queuing,
    publish and subscribe communication and various
    aspects of push/pull technologies.
  • JavaTM Transaction API (JTA)
  • JavaMail

10
Example Application 1
  • Location Advertisement Services

11
But
12
Web Page Example
13
HTML Code
  • lthtml gt
  • ltheadgt
  • ltmeta name"GENERATOR" content"Microsoft
    FrontPage 4.0"gt
  • ltmeta name"Microsoft Theme" content"global 101,
    default"gt
  • ltmeta name"Microsoft Border" content"tlrb,
    default"gt
  • lttitlegtHome Pagelt/titlegt lt/headgt
  • ltbody background"../../_themes/global/glotextb.gi
    f" bgcolor"FFFFCC" text"510000"
    link"999900" vlink"CC9966" alink"990066"gt
  • lttable border"0" cellpadding"0" cellspacing"0"
    width"100"gt
  • lttrgtlttdgtltfont face"Arial, Helvetica"gt
  • ltp align"center"gtltbrgt
  • ltfont size"4" face"Arial"gtStudent Learning
    Spacelt/fontgtlt/pgt
  • ltp align"center"gtlta href"../Default.htm"gtHomelt/a
    gtnbspnbsp lta href"../cmssem011/Module20speci
    fication.doc"gtModule
  • lta href"http//www.cms.livjm.ac.uk/markallen/mult
    i-media.htm"gtTutorialslt/agt lta href"../cmssem011/i
    ndicative_references.htm"gt Reading Listlt/agtlt/pgt
  • ltp align"left"gtltfont size"4"gtContemporary
    issues in IT Distributed Applications and
    E-Commerce ltemgtCMSCB3005lt/emgtltfont size"4"
    face"Arial"gtnbsplt/fontgtlt/fontgtlt/pgt
  • lt/htmlgt

14
Associated XML Code
  • lt?xml version"1.0"?gt gt
  • lt?xml-stylesheet type"text/xsl"
    href"..\xsl\ENR-change-table.xsl"?gt
  • lt!DOCTYPE Components SYSTEM "Project6.dtd"gt
  • ltheadgt
  • ltmeta name"Microsoft Theme" content"global 101,
    default"gt
  • lttitlegt Student Learning Space lt/titlegt lt/headgt
  • ltbodygt
  • ltmaingt
  • ltpage typehtml href"../Default.htm"gt
  • ltheadingsgt
  • ltheading 1 href"../cmssem011/Module20specifica
    tion.doc"gt
  • ltheading 2 href"http//www.cms.livjm.ac.
    uk/markallen/multi-media.htm"gt
  • ltheading 3 href"../cmssem011/indicative_referen
    ces.htm"gt
  • lt/headingsgt
  • lt/maingt
  • lt/bodygt
  • lt/xmlgt

15
What is XML?
  • XML is
  • an eXtensible Markup Language for describing both
    structured and unstructured information, which
    could be used on the web.
  • XML documents containing structured information
    including
  • Content words, pictures (vector graphics),
    e-commerce transactions, mathematical equations,
    object meta-data, server APIs, and other XML
    documents.
  • XML is a meta-language for defining other markup
    languages not like HTML or SGML
  • Unlike Html or SGML it provides
  • extensible tag semantics
  • a facility to define tags and the structural
    relationships between them.
  • All of the semantics of an XML document will
    either be defined by the applications that
    process them or by stylesheets.

16
How Is XML Defined?
  • XML is defined by a number of related
    specifications
  • Extensible Markup Language (XML) 1.0
  • Defining the syntax of XML.
  • XML Pointer Language (XPointer) and XML Linking
    Language (XLink)
  • Defining a standard way to represent links
    between resources. In addition to simple links,
    like HTML's ltAgt tag, XML has mechanisms for links
    between multiple resources and links between
    read-only resources.
  • XPointer describes how to address a resource,
  • XLink describes how to associate two or more
    resources.
  • Extensible Style Language (XSL)
  • Defines the standard stylesheet language for XML.
  • XQL -- Defines a standard query language for XML.
  • XUL -- Defines a standard user-interface language
    for XML.

17
XML Markup 1
  • Six kinds of markup used in XML documents
  • 1. Elements -- Delimited by angle brackets, most
    elements identify the nature of the content they
    surround.
  • It begins with a start-tag, ltelementgt, and ends
    with an end-tag, lt/elementgt.
  • Attributes -- Attributes are name-value pairs
    that occur inside start-tags after the element
    name.
  • ltdiv class"preface"gtis a div element with the
    attribute class having the value preface.
  • 2. entity references -- introduce markup into a
    document, some characters have been reserved to
    identify the start of markup.
  • entities are used to represent these special
    characters. Entities are also used to refer to
    often repeated or varying text and to include the
    content of external files.
  • Entity references begin with the ampersand and
    end with a semicolon.

18
XML Markup 2
  • For example, the lt entity inserts a literal lt
    into a document. So the string ltelementgt can be
    represented in an XML document as ltelementgt.
  • A special form of entity reference, called a
    character reference, can be used to insert
    arbitrary Unicode characters into your document.
    This is a mechanism for inserting characters that
    cannot be typed directly on your keyboard.
  • 3. Comments -- begin with lt!-- and end with --gt.
  • Comments can contain any data except the literal
    string.
  • 4. processing instructions (PIs) -- are an escape
    hatch to provide information to an application.
  • Processing instructions have the form lt?name
    pidata?gt. The name, called the PI target,
    identifies the PI to the application.
  • 5. CDATA Sections to instruct the parser to
    ignore most markup characters.
  • to prevent xml parser from evaluating a CDATA.
  • lt!CDATA p q b (i lt 3) gt 

19
XML Markup 3
  • Between the start of the section, lt!CDATA and
    the end of the section, gt, all character data
    is passed directly to the application, without
    interpretation.
  • The only string that cannot occur in a CDATA
    section is gt.
  • 6. Document Type Declarations
  • XML allows you to create your own tag names.
  • DTD enables document to communicate their
    meta-information to the parser including
  • allowed sequence and nesting of tags,
  • attribute values and their types
  • defaults, the names of external files that may be
    referenced
  • formats of some external (non-XML) data that may
    be referenced,
  • the entities that may be encountered.

20
Validation
  • Two categories of XML documents
  • Well-formed Documents
  • it obeys the syntax and the grammar of XML
    documents.
  • A document that includes sequences of markup
    characters that cannot be parsed or are invalid
    cannot be well-formed.
  • not well-formed document -- is not XML document.
  • well-formed and valid
  • well-formed document is valid only if it contains
    a proper document type declaration and if the
    document obeys the constraints of that
    declaration.

21
XML Document Parsing
Well-formed
XML
XML Document
Further processing of
Well-formed
Valid
XML
PARSER
22
XML Processing and Rendering
  • XML Document/DTD/Parser
  • Document Object Model (DOM)
  • Script/Programming (manipulation of objects)
  • XSL (render ready transformation)
  • Browser/Display Application
  • (rendering)

23
Combining Java and XML
24
Target System Architecture
25
Implementation 1
26
Implementation 2
27
Implementation 3
Write a Comment
User Comments (0)
About PowerShow.com