Presentation is loading. Please wait.

Presentation is loading. Please wait.

Software Design 8.1 XML and XSLT and other TLA's l XML: more than buzzword compliancy  Future of information interchange  Leverages Internet and TCP/IP.

Similar presentations

Presentation on theme: "Software Design 8.1 XML and XSLT and other TLA's l XML: more than buzzword compliancy  Future of information interchange  Leverages Internet and TCP/IP."— Presentation transcript:

1 Software Design 8.1 XML and XSLT and other TLA's l XML: more than buzzword compliancy  Future of information interchange  Leverages Internet and TCP/IP  Readable by humans and machines l What does XSLT do?  Transform XML to: HTML, XML, …  Programming Language l How to use these?  With Java (or other languages)  With IE

2 Software Design 8.2 Design Patterns: Abstract Factory l Provide an interface for creating families of related or dependent objects without specifying their concrete classes.  System is independent of how its products are created, composed, represented  Configured with one of multiple families of products  Family of products designed to be used together, this constraint should be enforced  Provide library, but reveal interfaces, not implementations l Makes exchanging product families simple l Supporting new products is difficult

3 Software Design 8.3 Design Patterns: Decorator l Attach additional responsibilities to an object dynamically. Decorators provide an alternative to subclassing  Add responsibilities dynamically and transparently, without affecting other objects  Withdraw responsibilities  Extension by subclass might be impractical l Decorate a component so that the component and the decorator (container) share the same interface  Lots of little objects that look alike, easy to customize if you understand, but hard to learn

4 Software Design 8.4 How Java works l The java compiler takes file and generates a.class file  The.class file contains Java bytecodes, the assembler language for Java programs  Bytecodes are executed in a JVM (java virtual machine), the valid bytecodes are specified by Sun What if third parties create platform/OS specific codes?  IBM has Jikes, a lightning fast compiler, others? l The JVM interprets the bytecodes  JVM is platform/OS specific, must ultimately run the code  Different JVMs will have different performance  Sun has HotSpot, previously the big thing was JITs Adaptive compilation vs. compile when executed

5 Software Design 8.5 From JITs to Deoptimization l JITs compile bytecodes when first executed  If we can cache translated code we can avoid re-translating the same bytecode sequence  Spend time compiling things that aren’t frequently executed (optimistic optimization?)  Errors indicate “compiled code” rather than line number l Sun’s HotSpot VM uses a different strategy for performance  Adaptive compilation: save time over JIT, compile “hotspots” rather than everything, uses less memory, starts program faster, …  No method inlining, but uses dynamic deoptimization Program loads new subclass, compiled code invalid, so …? l What does the class loader do?

6 Software Design 8.6 Loading.class files l The bytecode verifier “proves theorems” about the bytecodes being loaded into the JVM  These bytecodes may come from a non-Java source, e.g., compile Ada into bytecodes (why?) l This verification is a static analysis of properties such as: .class file format (including magic number 0xCAFEBABE)  Methods/instances used properly, parameters correct  Stack doesn’t underflow/overflow  … l Verification is done by the JVM, not changeable  Contrast ClassLoader, which is changeable, can modify classes before they’re loaded into the JVM

7 Software Design 8.7 The ClassLoader l The “boot strap” loader is built-in to the JVM  Sometimes called the “default” loader, but it’s not extensible or customizable the way other loaders are  Loads classes from the platform on which the JVM runs (what are loader and JVM written in?) l Applet class loader, RMI class loader, user loaders  Load.class files from URLs, from other areas of platform on which JVM runs  A class knows how it was loaded and new instances will use the same loader l Why implement a custom loader?  Work at Duke with JOIE

8 Software Design 8.8 Applications and Applets l An applet is a program delivered via the web  security issues, sandbox model  where does code/images/etc come from? How is it delivered?  what browsers support JDK 2.0 out-of-the box?  Use IE/Netscape with plugin, use Opera as is, use appletviewer for debugging, testing l Possible to wrap up lots of classes in a.jar file  java archive, similar to a tar file, possible to include.class files,.au,.gif, etc, so all code transferred at once

9 Software Design 8.9 CGI: Common Gateway Interface l l How do programs running on the server communicate with clients over the web?  Can do simple UI stuff in HTML: textfield, buttons, radio buttons, select/choicebox, checkbox, …  Communicate choices to client program via “parameters” l The communication is done by encoding text in a string that’s passed to program running on server  Server program can be written in Perl, C, C++, Java, …  Two forms of communication: get and post Post is more robust, no limit on size of string sent

10 Software Design 8.10 Setting up CGI programs l  Request a CGI key  Create a directory and give cgi.ola rliw permission  Put code in the directory, html pages can live anywhere l Debugging is tricky, probably want to debug from the command-line rather than over the web l Be sure to send appropriate header to start HTML page from server program when sending to client/browser  Missing header causes “internal server” or other error l See code examples and HTML sample for details  Server must parse arguments  Replace “+” with “ “, look for %xx args, replace them

Download ppt "Software Design 8.1 XML and XSLT and other TLA's l XML: more than buzzword compliancy  Future of information interchange  Leverages Internet and TCP/IP."

Similar presentations

Ads by Google