Presentation is loading. Please wait.

Presentation is loading. Please wait.

got ? Research Project – April 1998 Hang Xia, Mark Wang, Richard S. Chang Updated: R Norman, August 1999.

Similar presentations


Presentation on theme: "got ? Research Project – April 1998 Hang Xia, Mark Wang, Richard S. Chang Updated: R Norman, August 1999."— Presentation transcript:

1

2 got ? Research Project – April 1998 Hang Xia, Mark Wang, Richard S. Chang Updated: R Norman, August 1999

3 4 Why is Java so Hot? – because of the NETWORK!! 4 Why Java? –“Write Once, Use Anywhere”

4 Java Virtual Machine Java App/Servlet & JavaScript Java Language Agenda

5 Java Virtual Machine

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

7 Java Development and Java Runtime Environment (JRE)

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

9 Java Applet Java Servlet JavaScript

10 What is a Java Applet? 4 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. 4 Example applet tag in HTML file:

11 How a Java Applet works 4 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. 4 Java-Compatible Browsers: HotJava, Netscape Navigator, Internet Explorer, etc.

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

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

14 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 >... alternateHTML ( Applet Tag )

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

16 Is JavaScript Simplified Java? NO

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

18 Embedding JavaScript in HTML 4 Explicit Way JavaScript statements … 4 Implicit Way …

19 Java Language

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

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

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

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

24 Build Cycle

25 Build Cycle (cont.)

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

27 Questi ns ?


Download ppt "got ? Research Project – April 1998 Hang Xia, Mark Wang, Richard S. Chang Updated: R Norman, August 1999."

Similar presentations


Ads by Google