Prof. A. Taleb-Bendiab Room 605


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Login system identify the different users System Operator input the search criteria into search engine. The search engine retrieve the results from back-end DB. The results were sent to the Fire fighter. The system admin will take in charge of system maintenance.
  • Prof. A. Taleb-Bendiab Room 605

    1. 1. Distributed Application Services and E-business Part II
    2. 2. So far … <ul><li>E-business </li></ul><ul><ul><li>Definitions, E-business Models </li></ul></ul><ul><ul><li>E-business Patterns </li></ul></ul><ul><ul><li>Systems requirements </li></ul></ul><ul><li>E-business drivers for Multi-tier Applications Architecture </li></ul><ul><li>Emerging web development technologies </li></ul><ul><ul><li>Thin versus Thick Clients, and Thin server vs Thick server </li></ul></ul><ul><li>In this session …. </li></ul><ul><ul><li>A brief introduction to Java </li></ul></ul><ul><ul><ul><li>Brief introduction to Java </li></ul></ul></ul><ul><ul><li>Overview of XML </li></ul></ul><ul><ul><ul><li>Web applications using Java and XML </li></ul></ul></ul><ul><ul><ul><li>An example web application services </li></ul></ul></ul><ul><ul><li>Tutorial session </li></ul></ul>
    3. 3. What is Java? <ul><li>Java language and environment </li></ul><ul><ul><li>Born on May 23rd 1995. </li></ul></ul><ul><ul><li>Grew out of a product called Oak </li></ul></ul><ul><ul><ul><li>Oak was designed for embedded software and consumer devices. </li></ul></ul></ul><ul><ul><ul><li>See </li></ul></ul></ul><ul><li>Java is an environment is </li></ul><ul><ul><li>Ideal environment for writing object-oriented, distributed and platform independent applications, real-time, etc. </li></ul></ul><ul><li>Java has a lot in common with C and C++ </li></ul><ul><li>Versions and editions </li></ul>1.0 1.1 Java 2 Platform Enterprise edition Standard edition Micro edition
    4. 4. The Java timeline 1995 1996 1997 1998 1999 JDK 1.1 ships May - Sun launches Java (alpha version) on the Internet January - Java Development Kit (JDK) 1.0 ships Sun announces Java 2 Platform (JDK 1.2) Sun announces Jini technology Sun announces Java 2 Platform (JDK 1.3) 2000 Sun announces Java 2 Platform (JDK 1.4) 2001 ++ Many more
    5. 5. How does it work? <ul><li>A Java program is compiled into bytecodes </li></ul><ul><li>These bytecodes are interpreted by a JVM </li></ul><ul><li>The JVM converts these instructions into appropriate machine code </li></ul><ul><li>The program executes on the machine </li></ul><ul><li>Each platform therefore needs its own JVM </li></ul><ul><ul><li>Enabling WORA -- “Write Once, Run Anywhere” </li></ul></ul><ul><li>Java Virtual Machine </li></ul><ul><ul><li>“ An imaginary machine that is implemented by emulating it in software on a real machine.” </li></ul></ul><ul><ul><li>It specifies: Instruction set, register set, class file format, stack, garbage collection, memory area </li></ul></ul><ul><ul><li>A JVM exists for various operating systems including; </li></ul></ul><ul><ul><ul><li>Windows 95/98/NT/2000, Solaris, Macintosh, OS/2, Linux, OS/400, OS/390, HPUX, AIX, IRIX, EPOC, Windows CE, PlamOS, etc. </li></ul></ul></ul>
    6. 6. Java Runtime Environment Java source (java) Java compiler Java byte code (class) Java byte codes move locally or through network Class loader Byte code verifier Java class libraries Java interpreter Just-in-time compiler Runtime system Operating system Hardware
    7. 7. Running Java Programs <ul><li>A Java application is a stand-alone program that can use all of the features of the Java language environment </li></ul><ul><li>A Java applet is a restricted Java application that is designed to be run inside a Java-enabled web browser </li></ul><ul><ul><li>Security restrictions </li></ul></ul><ul><ul><li>Applets have a different lifecycle to applications </li></ul></ul><ul><li>A Java servlet is the equivalent of an applet, which is executed at server-side </li></ul><ul><ul><li>It is a Java application that is designed to be run inside a Http servers </li></ul></ul>
    8. 8. <ul><li>  /** C omments here – Example of authenticator class */ </li></ul><ul><li>package test;  </li></ul><ul><li>import java.util.*; </li></ul><ul><li>import*;  </li></ul><ul><li>import com.server.http.*;  </li></ul><ul><li>public class TestAuthenticator extends AbstractAuthenticator { </li></ul><ul><li>public void init(CauchoApplication app, RegistryNode params) { }  </li></ul><ul><li>public Principal authenticateCookie(String cookieValue) { return null; }  </li></ul><ul><li>public Principal authenticate(String user, String password) { </li></ul><ul><li>if (password != null && password.equals(&quot;quidditch&quot;)) return new BasicPrincipal(user); </li></ul><ul><li>else return null; }  </li></ul><ul><li>public boolean updateCookie(Principal user, String cookieValue) </li></ul><ul><li>{return true; }  </li></ul><ul><li>public boolean isUserInRole(Principal user, String role) </li></ul><ul><li>{return user != null && &quot;user&quot;.equals(role);  </li></ul><ul><li>} } </li></ul>Examples: Java Programme
    9. 9. Java 2 Enterprise Edition <ul><li>Enterprise JavaBeans TM Architecture </li></ul><ul><ul><li>De fines an API t o enable developers to create, deploy and manage cross-platform, component-based enterprise applications. </li></ul></ul><ul><li>JavaServer Pages TM </li></ul><ul><ul><li>Enables rapid development of server-side web-based applications , such as; dynamic web content management . </li></ul></ul><ul><li>Java TM Servlet </li></ul><ul><li>Java Naming and Directory Interface TM (JNDI) </li></ul><ul><li>Java TM Message Service (JMS) </li></ul><ul><ul><li>Provides a standard Java API for enterprise messaging services such as reliable queuing, publish and subscribe communication and various aspects of push/pull technologies. </li></ul></ul><ul><li>Java TM Transaction API (JTA) </li></ul><ul><li>JavaMail </li></ul>
    10. 10. Example Application #1 <ul><li>Location & Advertisement Services </li></ul>
    11. 11. … But … Request Data source Web Layer Response
    12. 12. Web Page Example
    13. 13. HTML Code <ul><li><html > </li></ul><ul><li><head> </li></ul><ul><li><meta name=&quot;GENERATOR&quot; content=&quot;Microsoft FrontPage 4.0&quot;> </li></ul><ul><li><meta name=&quot;Microsoft Theme&quot; content=&quot;global 101, default&quot;> </li></ul><ul><li><meta name=&quot;Microsoft Border&quot; content=&quot;tlrb, default&quot;> </li></ul><ul><li><title>Home Page</title> </head> </li></ul><ul><li><body background=&quot;../../_themes/global/glotextb.gif&quot; bgcolor=&quot;#FFFFCC&quot; text=&quot;#510000&quot; link=&quot;#999900&quot; vlink=&quot;#CC9966&quot; alink=&quot;#990066&quot;> </li></ul><ul><li><table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; width=&quot;100%&quot;> </li></ul><ul><li><tr><td > <font face=&quot;Arial, Helvetica&quot;> </li></ul><ul><li><p align=&quot;center&quot;><br> </li></ul><ul><li><font size=&quot;4&quot; face=&quot;Arial&quot;>Student Learning Space</font></p> </li></ul><ul><li><p align=&quot;center&quot;><a href=&quot;../Default.htm&quot;>Home</a>&nbsp;&nbsp; <a href=&quot;../cmssem011/Module%20specification.doc&quot;>Module </li></ul><ul><li><a href=&quot;;>Tutorials</a> <a href=&quot;../cmssem011/indicative_references.htm&quot;> Reading List</a></p> </li></ul><ul><li><p align=&quot;left&quot;><font size=&quot;4&quot;>Contemporary issues in IT: Distributed Applications and E-Commerce <em>CMSCB3005</em><font size=&quot;4&quot; face=&quot;Arial&quot;>&nbsp;</font></font></p> </li></ul><ul><li></html> </li></ul>
    14. 14. Associated XML Code <ul><li>< ?xml version=&quot;1.0&quot;?> > </li></ul><ul><li>< ?xml-stylesheet type=&quot;text/xsl&quot; href=&quot;..xslENR-change-table.xsl&quot;?> </li></ul><ul><li><!DOCTYPE Components SYSTEM &quot;Project6.dtd&quot;> </li></ul><ul><li><head> </li></ul><ul><li><meta name=&quot;Microsoft Theme&quot; content=&quot;global 101, default&quot;> </li></ul><ul><li><title> Student Learning Space </title> </head> </li></ul><ul><li>< body > </li></ul><ul><li>< main> </li></ul><ul><li><page type=“html” href=&quot;../Default.htm&quot;> </li></ul><ul><li><headings> </li></ul><ul><li>< heading 1 hr ef=&quot;../cmssem011/Module%20specification.doc&quot;> </li></ul><ul><li>< heading 2 href=&quot;;> </li></ul><ul><li><heading 3 href=&quot;../cmssem011/indicative_references.htm&quot;> </li></ul><ul><li></headings> </li></ul><ul><li></main> </li></ul><ul><li></body> </li></ul><ul><li></ x ml> </li></ul>
    15. 15. What is XML? <ul><li>XML is </li></ul><ul><ul><li>an eXtensible Markup Language for describing both structured and unstructured information, which could be use d o n the web. </li></ul></ul><ul><ul><li>XML documents containing structured information including; </li></ul></ul><ul><ul><ul><li>Content: words, pictures ( vector graphics ) , e-commerce transactions, mathematical equations, object meta-data, server APIs, and other XML documents . </li></ul></ul></ul><ul><ul><li>XML is a meta-language for defining other markup languages not like HTML or SGML </li></ul></ul><ul><li>Unlike Html or SGML it provides; </li></ul><ul><ul><li>extensible tag semantics </li></ul></ul><ul><ul><li>a facility to define tags and the structural relationships between them. </li></ul></ul><ul><ul><li>All of the semantics of an XML document will either be defined by the applications that process them or by stylesheets. </li></ul></ul>
    16. 16. How Is XML Defined? <ul><li>XML is defined by a number of related specifications: </li></ul><ul><ul><li>Extensible Markup Language (XML) 1.0 </li></ul></ul><ul><ul><ul><li>Defin ing the syntax of XML . </li></ul></ul></ul><ul><ul><li>XML Pointer Language ( XPointer ) and XML Linking Language ( XLink ) </li></ul></ul><ul><ul><ul><li>Defining a standard way to represent links between resources. In addition to simple links, like HTML's <A> tag, XML has mechanisms for links between multiple resources and links between read-only resources. </li></ul></ul></ul><ul><ul><ul><ul><li>XPointer describes how to address a resource, </li></ul></ul></ul></ul><ul><ul><ul><ul><li>XLink describes how to associate two or more resources. </li></ul></ul></ul></ul><ul><ul><li>Extensible Style Language (XSL) </li></ul></ul><ul><ul><ul><li>Defines the standard stylesheet language for XML. </li></ul></ul></ul><ul><ul><li>XQL -- Defines a standard query language for XML. </li></ul></ul><ul><ul><li>XUL -- Defines a standard user-interface language for XML. </li></ul></ul>
    17. 17. XML Markup #1 <ul><li>Six kinds of markup used in XML document s : </li></ul><ul><ul><li>1. Elements -- Delimited by angle brackets, most elements identify the nature of the content they surround. </li></ul></ul><ul><ul><ul><li>I t begins with a start-tag, <element> , and ends with an end-tag, </element> . </li></ul></ul></ul><ul><ul><ul><li>Attributes -- Attributes are name-value pairs that occur inside start-tags after the element name. </li></ul></ul></ul><ul><ul><ul><ul><li><div class=&quot;preface&quot;> is a div element with the attribute class having the value preface . </li></ul></ul></ul></ul><ul><ul><li>2. entity references -- introduce markup into a document, some characters have been reserved to identify the start of markup. </li></ul></ul><ul><ul><ul><li>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. </li></ul></ul></ul><ul><ul><ul><li>Entity references begin with the ampersand and end with a semicolon. </li></ul></ul></ul>
    18. 18. XML Markup #2 <ul><ul><ul><li>For example, the lt entity inserts a literal < into a document. So the string <element> can be represented in an XML document as &lt;element> . </li></ul></ul></ul><ul><ul><ul><ul><li>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. </li></ul></ul></ul></ul><ul><li>3. Comments -- begin with <!-- and end with --> . </li></ul><ul><ul><li>Comments can contain any data except the literal string. </li></ul></ul><ul><li>4. processing instructions (PIs) -- are an escape hatch to provide information to an application. </li></ul><ul><ul><li>Processing instructions have the form: <?name pidata?> . The name, called the PI target, identifies the PI to the application. </li></ul></ul><ul><li>5. CDATA Sections – to instruct the parser to ignore most markup characters. </li></ul><ul><ul><li>to prevent xml parser from evaluating a CDATA. </li></ul></ul><ul><ul><li><![CDATA[ *p = &q; b = (i <= 3); ]]>  </li></ul></ul>
    19. 19. XML Markup #3 <ul><ul><li>Between the start of the section, <![CDATA[ and the end of the section, ]]> , all character data is passed directly to the application, without interpretation. </li></ul></ul><ul><ul><li>The only string that cannot occur in a CDATA section is ]]> . </li></ul></ul><ul><li>6. Document Type Declarations </li></ul><ul><ul><li>XML allows you to create your own tag names. </li></ul></ul><ul><ul><li>DTD enables document to communicate their meta-information to the parser including; </li></ul></ul><ul><ul><ul><li>allowed sequence and nesting of tags, </li></ul></ul></ul><ul><ul><ul><li>attribute values and their types </li></ul></ul></ul><ul><ul><ul><li>defaults, the names of external files that may be referenced </li></ul></ul></ul><ul><ul><ul><li>formats of some external (non-XML) data that may be referenced, </li></ul></ul></ul><ul><ul><ul><li>the entities that may be encountered. </li></ul></ul></ul>
    20. 20. Validation <ul><li>Two categories of XML documents: </li></ul><ul><ul><li>Well-formed Documents </li></ul></ul><ul><ul><ul><li>it obeys the syntax and the grammar of XML documents. </li></ul></ul></ul><ul><ul><ul><li>A document that includes sequences of markup characters that cannot be parsed or are invalid cannot be well-formed. </li></ul></ul></ul><ul><ul><ul><li>not well-formed document -- is not XML document . </li></ul></ul></ul><ul><ul><li>well-formed and valid: </li></ul></ul><ul><ul><ul><li>well-formed document is valid only if it contains a proper document type declaration and if the document obeys the constraints of that declaration. </li></ul></ul></ul>
    21. 21. XML Document Parsing Well-formed XML Well-formed & Valid XML PARSER Further processing of XML Document Well- formed? XML Document DTD DTD Required? Valid? Yes Yes No No No XML Syntax Error Message Structural Non-conformance Error Message Stop Processing / Edit XML and/or DTD / Re-initiate Parsing
    22. 22. XML Processing and Rendering <ul><li>XML Document/DTD/Parser </li></ul><ul><li>Document Object Model (DOM) </li></ul><ul><li>Script/Programming (manipulation of objects) </li></ul><ul><li>XSL (render ready transformation) </li></ul><ul><li>Browser/Display Application </li></ul><ul><li>(rendering) </li></ul>XML Document DTD PARSER DOM XML API Application Script/Program XSL XSL-based Processing layer HTML Output RTF (MS Word) SAX PDF Output Other Markup Languages WML Scalable Vector Graphics (SVG) RDF, XMI Etc.
    23. 23. Combining Java and XML Mobilisation tool Fire Fighter Search Engine Login System C&C Operator System Admin. Admin tools Reporting tools Communication RDBMS
    24. 24. Target System Architecture
    25. 25. Implementation #1
    26. 26. Implementation #2
    27. 27. Implementation #3