Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Why JAVA ?
Topics on the presentation
• JAVA is VM, development tools, language & packages
• Networking
• Embedded system & JAVA
• License and cost
Author:
Qi Wu
Samstag, 7. April 2001
Why JAVA ?
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
Samstag, 7. April 2001
Why JAVA ?
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
Samstag, 7. April 2001
Why JAVA ?
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
Samstag, 7. April 2001
Why JAVA ?
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
Samstag, 7. April 2001
Why JAVA ?
JAVA VM (Virtual Machine)
Application 1 (JAVA)
Application 2 (JAVA)
Application 3 (JAVA)
Application X (JAVA)
JAVA byte code
JAVA VM
API (Application Programming Interface)
Packages
OS kernel
Software device drivers
Hardware interfaces
JAVA specifications
VM producer’s job
JAVA is VM, development tools, language & packages
Samstag, 7. April 2001
Why JAVA ?
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
Samstag, 7. April 2001
Why JAVA ?
java.net.* and java.awt.* are important packages
Application 1 (JAVA)
Application 2 (JAVA)
Application 3 (JAVA)
Application X (JAVA)
JAVA byte code
JAVA VM
API
TCP/IP
GUI
Packages
(java.net.*
java.awt.*
...)
OS kernel
Software device drivers
Hardware interfaces
JAVA specifications
VM producer’s job
JAVA is VM, development tools, language & packages
Samstag, 7. April 2001
Why JAVA ?
JDK (Java Development Kit)
Specification
JDK 1.0
JDK 1.13
JDK 1.3 (JAVA 2)
Window 95/98/NT/2000
x
x
x
Linux
TBD
x
JAVA is VM, development tools, language & packages
Samstag, 7. April 2001
Why JAVA ?
Sub-directories of JAVA 1.3 (Java 2) based on Sun’s Standard Edition
JDK 1.3 root directory
bin
include
lib
demo
jre
•
•
•
•
•
javac.exe --- compiler
jdb.exe --- debugger
java.exe --- Java VM
appletviewer.exe
....
•
•
src.jar --- packages
....
JAVA is VM, development tools, language & packages
Samstag, 7. April 2001
Why JAVA ?
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
Samstag, 7. April 2001
Why JAVA ?
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
Samstag, 7. April 2001
Why JAVA ?
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
Samstag, 7. April 2001
Why JAVA ?
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
Samstag, 7. April 2001
Why JAVA ?
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
Samstag, 7. April 2001
Why JAVA ?
Networking buzzwords
Internet
EJB
Intranet
http
Servlet
socket
Applet
Client/server
...
TCP/IP
Networking
Samstag, 7. April 2001
Why JAVA ?
Generic & basic networking layer structure
Application Protocol (http, ...)
TCP/UDP/IP
Abstract layer
Physical link
Hardware interfaces
Networking
Samstag, 7. April 2001
Why JAVA ?
Java networking solution
JAVA VM
Application Protocol (http, ...)
TCP/UDP/IP
Packages
(java.net.*
...)
JAVA specifications
Networking
Samstag, 7. April 2001
Why JAVA ?
Client/server concept (two or more machines)
Pooling & response thread
Client
JAVA VM
Application Protocol (http, ...)
Request thread
TCP/UDP/IP
JAVA VM
Application Protocol (http, ...)
TCP/UDP/IP
Server
Networking
Samstag, 7. April 2001
Why JAVA ?
Client/server concept (two o more machines)
Pooling & response thread
Client
JAVA VM
Application Protocol (http, ...)
Request thread
TCP/UDP/IP
Application Protocol (http, ...)
TCP/UDP/IP
Server
Networking
Samstag, 7. April 2001
Why JAVA ?
Client/server concept (one machine)
Pooling & response thread
Request thread
JAVA VM
Application Protocol (http, ...)
TCP/UDP/IP
Networking
Samstag, 7. April 2001
Why JAVA ?
Client/server concept (one machine)
Pooling & response thread
Request thread
JAVA VM
Application Protocol (http, ...)
TCP/UDP/IP
Networking
Samstag, 7. April 2001