got - PowerPoint PPT Presentation

1 / 26
About This Presentation
Title:

got

Description:

Java-Compatible Browsers: HotJava, Netscape Navigator, Internet Explorer, etc. ... Standalone Java programs that can be run by using just the Java interpreter. ... – PowerPoint PPT presentation

Number of Views:61
Avg rating:3.0/5.0
Slides: 27
Provided by: RSCC
Category:

less

Transcript and Presenter's Notes

Title: got


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
  • ltapplet codeMyApplet.class width100
    height80gt
  • lt/appletgt

10
How a Java Applet works
  • When we use a Java-compatible browser to view a
    Web page which contains a Java applet, the
    applets 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
  • ltAPPLET
  • CODEBASE codebaseURL
  • ARCHIVE archiveList
  • CODE appletFile ...or... OBJECT
    serializedApplet
  • ALT alternateText
  • NAME appletInstanceName
  • WIDTH pixels HEIGHT pixels
  • ALIGN alignment
  • VSPACE pixels HSPACE pixels gt
  • ltPARAM NAME appletAttribute1 VALUE
    valuegt
  • ltPARAM NAME appletAttribute2 VALUE
    valuegt
  • . . .
  • alternateHTML
  • lt/APPLETgt
    ( 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
  • ltSCRIPTgt
  • JavaScript
    statements
  • lt/SCRIPTgt
  • Implicit Way
  • ltSCRIPT
    SRCcommon.jsgt
  • lt/SCRIPTgt

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 ?
Write a Comment
User Comments (0)
About PowerShow.com