1 / 26

got ?

got ?. Research Project – April 1998 Hang Xia, Mark Wang, Richard S. Chang Updated: R Norman, August 1999. Why is Java so Hot? because of the NETWORK!! Why Java? “Write Once, Use Anywhere”. Agenda. Java Virtual Machine Java App/Servlet & JavaScript Java Language.

minna
Download Presentation

got ?

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. got ? Research Project – April 1998 Hang Xia, Mark Wang, Richard S. Chang Updated: R Norman, August 1999

  2. Why is Java so Hot? because of the NETWORK!! Why Java? “Write Once, Use Anywhere”

  3. Agenda • Java Virtual Machine • Java App/Servlet & JavaScript • Java Language

  4. Java Virtual Machine

  5. Java Virtual Machine • What is the JVM? • A Java Interpreter • Software, not hardware • Converts bytecode into machine code • Why JVM is important? • Platform-Independent

  6. Java Development andJava Runtime Environment (JRE)

  7. Java Development Kit (JDK) • A development environment for writing • Java Applets & Servlets • Java Applications • JDK contains • Java Core Classes • Java Source Files • Java Tools (compiler, Interpreter, appletviewer, debugger, etc.) • Java Documentation and Demos

  8. Java Applet Java Servlet JavaScript

  9. What is a Java Applet? • A Java program that can be included in an HTML page. • An applet tag is used in the HTML file to identify the source of the applet code, which resides on the server. • Example applet tag in HTML file: <applet code=“MyApplet.class” width=100 height=80> </applet>

  10. How a Java Applet works • When we use a Java-compatible browser to view a Web page which contains a Java applet, the applet’s code is transferred to our system and executed by the browser. • Java-Compatible Browsers: HotJava, Netscape Navigator, Internet Explorer, etc.

  11. Why a Java Applet? ADVANTAGES: • Less load on the server • More user interaction (Applet Vs. CGI) • Arbitrary graphics • Arbitrary data types

  12. Java Applets Vs. Java Applications • Java Application: Standalone Java programs that can be run by using just the Java interpreter. • Java Applet: Run and displayed inside a Web page with Java-enabled Web browser.

  13. Embedding Applet in HTML <APPLET CODEBASE = codebaseURL ARCHIVE = archiveList CODE= appletFile...or... OBJECT = serializedApplet ALT = alternateText NAME = appletInstanceName WIDTH = pixels HEIGHT = pixels ALIGN = alignment VSPACE = pixels HSPACE = pixels> <PARAM NAME = appletAttribute1 VALUE = value> <PARAM NAME = appletAttribute2 VALUE = value> . . . alternateHTML </APPLET> ( Applet Tag )

  14. What is JavaScript? JavaScript is a cross-platform, object-based scripting language for client and server applications. • Untyped language • Purely interpreted language

  15. Is JavaScript Simplified Java? NO

  16. JavaScript Vs. Java • JavaScript -- Interpreted (not compiled) by client. Code integrated with and embedded in HTML. • Java -- Compiled bytecodes downloaded from server, executed on client. Applets distinct from HTML (accessed from HTML pages).

  17. Embedding JavaScript in HTML • Explicit Way <SCRIPT> JavaScript statements … </SCRIPT> • Implicit Way <SCRIPT SRC=“common.js”> … </SCRIPT>

  18. Java Language

  19. Java Language • Syntactically similar to C++ • Semantically different • Strong and statically typed • Single inheritance plus an interface mechanism • Run-time type information • Automatic storage management: • No pointers • Garbage collection • Security/safety

  20. Advantages of Java • Combine many programming mechanisms • Object oriented language • Strongly and statically typed • Automatic storage management: garbage collection • Run-time type information • Safety • Faster build cycle (prototyping) • Dynamic linking

  21. Advantages of Java (cont.) • Platform independence • The ability of write code once and use it anywhere • The ultimate in portability • Compiled code can move around a network • Java is “Open” • Documentation and source code available • Not tied down to a single vendor (i.e. Sun or Microsoft)

  22. Disadvantages of Java • Implementations have traditionally been interpreted • Execute slower than compiled languages • Typically in the order of 10x slower than native code • “Write Once, Run Anywhere” Implementation challenges • Is Microsoft playing????

  23. Build Cycle

  24. Build Cycle (cont.)

  25. JIT Compilation • “Just-in-time” compilation: • Convert Java bytecodes to native code as they are executed • Total execution time = compilation time + run time

  26. Questi ns ?

More Related