220 likes | 237 Views
Topics on the presentation. JAVA is VM, development tools, language & packages Networking Embedded system & JAVA License and cost. Author: Qi Wu. Applications on generic OS (Operating System). Application 1 (ANSI C). Application 2 (C++). Application 3 (Pascal). Application X (VB).
E N D
Topics on the presentation • JAVA is VM, development tools, language & packages • Networking • Embedded system & JAVA • License and cost Author: Qi Wu
Applications on generic OS (Operating System) Application 1 (ANSI C) Application 2 (C++) Application 3 (Pascal) Application X (VB) API (Application Programming Interface) OS kernel Software device drivers OS Hardware interfaces JAVA is VM, development tools, language & packages
Features of the architecture • API is much more dependent of an OS and/or selected hardware platform. • Applications are written in different programming languages and connected with certain API. • Performance/benchmark of an application is also affected by the OS and hardware platform. What will happen if the OS or hardware platform changed ? JAVA is VM, development tools, language & packages
Applications on generic OS (Operating System) Application 1 (ANSI C) Application 2 (C++) Application 3 (Pascal) Application X (VB) To be updated API (Application Programming Interface) OS kernel Software device drivers OS Hardware interfaces JAVA is VM, development tools, language & packages
Portability • Selection of a OS or hardware platform is often requirement from big customer. • Update of existing applications needs additional efforts and time. • Maintain of applications becomes problem. JAVA is VM, development tools, language & packages
JAVA VM (Virtual Machine) Application 1 (JAVA) Application 2 (JAVA) Application 3 (JAVA) Application X (JAVA) JAVA byte code Packages JAVA VM API (Application Programming Interface) OS kernel Software device drivers Hardware interfaces JAVA specifications VM producer’s job JAVA is VM, development tools, language & packages
Features of the architecture • VM is upward standard according to JAVA specification and downward specific to an OS • Business strategy drives producer of an OS to release JAVA VM in some case. Some communities are also working hard on JAVA VM for different OS like Windows 95/98/NT/2000, Window CE, Linux, QNX... • Application is written once and run everywhere (theoretically). More and more applications are written in JAVA and treated to be independent of certain OS. • Performance/benchmark of an application is also affected by the OS, hardware platform and JAVA VM. • Packages are collection of specified or often-used classes. Standard JAVA specification defines rich classes for diverse applications. JAVA is VM, development tools, language & packages
java.net.* and java.awt.* are important packages Application 1 (JAVA) Application 2 (JAVA) Application 3 (JAVA) Application X (JAVA) JAVA byte code Packages (java.net.* java.awt.* ...) JAVA VM API TCP/IP GUI OS kernel Software device drivers Hardware interfaces JAVA specifications VM producer’s job JAVA is VM, development tools, language & packages
JDK (Java Development Kit) JAVA is VM, development tools, language & packages
Sub-directories of JAVA 1.3 (Java 2) based on Sun’s Standard Edition JDK 1.3 root directory • javac.exe --- compiler • jdb.exe --- debugger • java.exe --- Java VM • appletviewer.exe • .... bin include lib demo jre • src.jar --- packages • .... JAVA is VM, development tools, language & packages
Example 1: Welcome.java public class Welcome { public static void main(String[ ] args) { String greeting[ ] = new String[3]; greeting[0] = “Welcome to Hannover”; greeting[1] = “by Qi Wu”; greeting[2] = “on April 08, 2001”; for (int i = 0; i < greeting.length; ++i) System.out.println(greeting[i]); } } JAVA is VM, development tools, language & packages
Example 1: Welcome.java C:\JAVATEST>javac Welcome.java C:\JAVATEST>java Welcome.class ... Welcome to Hannover by Qi Wu on April 08, 2001 ... C:\JAVATEST>_ JAVA is VM, development tools, language & packages
Features of Java language • The concept of class dominates all Java • Java is OOP • Garbage collection • Java Interface • Easy to design, code and test • Most data exchanges are based on reference • ... JAVA is VM, development tools, language & packages
Example 2: Welcome.java public class NewWelcome { public String getLine(String strArray[ ]) { return strArray[ 0] + “ “+ strArray[ 1] + “ “+ strArray[ 2]; } } public class Welcome { public Welcome { NewWelcome myNewWelcomeObject = new NewWelcome(); System.out.println( myNewWelcomeObject.getLine(greeting) ); } public static void main(String[ ] args) { String greeting[ ] = new String[3]; greeting[0] = “Welcome to Hannover”; greeting[1] = “by Qi Wu”; greeting[2] = “on April 08, 2001”; Welcome myWelcomeObject = new Welcome(); } } JAVA is VM, development tools, language & packages
What is class? A class is usually described as the template or blueprint from which the object is actually made. JAVA is VM, development tools, language & packages
Networking buzzwords Internet EJB Intranet http Servlet socket Applet Client/server ... TCP/IP Networking
Generic & basic networking layer structure Application Protocol (http, ...) TCP/UDP/IP Abstract layer Physical link Hardware interfaces Networking
Java networking solution JAVA VM Application Protocol (http, ...) Packages (java.net.* ...) TCP/UDP/IP JAVA specifications Networking
JAVA VM JAVA VM Application Protocol (http, ...) Application Protocol (http, ...) TCP/UDP/IP TCP/UDP/IP Client/server concept (two or more machines) Pooling & response thread Client Request thread Server Networking
JAVA VM Application Protocol (http, ...) TCP/UDP/IP Client/server concept (two o more machines) Pooling & response thread Client Request thread Application Protocol (http, ...) TCP/UDP/IP Server Networking
JAVA VM Application Protocol (http, ...) TCP/UDP/IP Client/server concept (one machine) Pooling & response thread Request thread Networking
Client/server concept (one machine) Pooling & response thread Request thread JAVA VM Application Protocol (http, ...) TCP/UDP/IP Networking