Вы находитесь на странице: 1из 26

What is Java?

山口 浩
Java IS ...

•Simple •High-Performance
•Object Oriented •Multi-Threaded
•Distributed •Dynamic
•Robust
•Secure
•Architecture Neutral
•Portable
•Integrated
2
TIOBE Programming Community Index

http://www.tiobe.com/index.php/content/paperinfo/tpci/
3
TIOBE Programming Community Index
Position Position Delta in Programming Ratings Delta Status
Feb 2010 Feb 2009 Position Language Feb 2010 Feb 2009
1 1 Java 17.35% -2.05%   A
2 2 C 16.60% +0.76%   A
3 5 PHP 10.00% +1.22%   A
4 3 C++ 9.45% -0.19%   A
5 4 (Visual) Basic 7.05% -1.79%   A
6 6 C# 5.02% -0.05%   A
7 7 Python 4.31% -0.25%   A
8 8 Perl 3.60% -0.52%   A
9 9 Delphi 2.66% -0.97%   A
10 10 JavaScript 2.64% -0.90%   A
11 11 Ruby 2.44% -0.84%   A
12 32 Objective-C 1.78% +1.60%   A
13 - Go 1.78% +1.78%   A-
14 14 SAS 0.77% -0.06%   A
15 13 PL/SQL 0.74% -0.25%   A
16 17 ABAP 0.66% +0.09%   B
17 16 Pascal 0.61% -0.08%   B
18 18 ActionScript 0.58% +0.04%   B
19 23 Lisp/Scheme 0.56% +0.13%   B
20 24 MATLAB 0.54% +0.12%   B
http://www.tiobe.com/index.php/content/paperinfo/tpci/
4
Release History
Date Release
1/23/1996 JDK 1.0
2/19/1997 JDK 1.1
12/8/1998 J2SE 1.2
5/8/2000 J2SE 1.3
2/6/2002 J2SE 1.4
9/30/2004 J2SE 5.0
12/11/2006 Java SE 6
10/16/2008 Java SE 6, update 10
1/13/2010 Java SE 6, update 18
http://en.wikipedia.org/wiki/Java_version_history
5
Java VM - Performance

6
Java VM Architecture

compile execute Java VM


----------- 00111111101
-----------
----------- 01110101011
----------- 11100101001
-----------
----------- 01010100100 Class Loader
----------- 10100101010
------- 01011010010
1001
Bytecode Verifier
Java source code Java Bytecode

Interpreter

Runtime System

OS

Hardware

7
Simple Java Program

import java.math.BigDecimal;

public class Multiply {


! public static void main(String args[]) {
! ! BigDecimal x = new BigDecimal(args[0]);
! ! BigDecimal y = new BigDecimal(args[1]);
! ! BigDecimal z = x.multiply(y);
! ! System.out.println(x + " * " + y + " = " + z);
! }
}

8
Bytecode(Java VM Instructions)
Method void main(java.lang.String[])
0 new #2 <Class java.math.BigDecimal> 200 Java VM instructions
3 dup
4 aload_0
5 iconst_0
6 aaload
7 invokespecial #3 <Method java.math.BigDecimal(java.lang.String)>
10 astore_1
11 new #2 <Class java.math.BigDecimal>
14 dup
15 aload_0
16 iconst_1
17 aaload
18 invokespecial #3 <Method java.math.BigDecimal(java.lang.String)>
21 astore_2
22 aload_1
23 aload_2
24 invokevirtual #4 <Method java.math.BigDecimal multiply(java.math.BigDecimal)>
27 astore_3
28 getstatic #5 <Field java.io.PrintStream out>
31 new #6 <Class java.lang.StringBuffer>
34 dup
...
60 invokevirtual #12 <Method java.lang.String toString()>
63 invokevirtual #13 <Method void println(java.lang.String)>
66 return

9
Performance Improvements

•Java Compiler Improvements


- Bytecode optimization
- Bytecode inlining

•Java Interpreter Improvements


- JIT (Just in Time) Compiler
- HotSpot Performance Engine
- Garbage Collection Algorithms
- Locking Mechanism

•Class Library Improvements

10
Performance Improvements
Server benchmark: Volano 2.5.0.9

800 2005
2004

600

2001 2003

400

200

1998

0
J2SE 1.2.2 J2SE 1.3.1_16 J2SE 1.4.2_11 J2SE 5.0_06 Java SE 6.0
Sun JVMs are 32-bit
Sun Fire V490: Solaris 9 / SPARC
Volano Website: http://www.volano.com
Source: Java Performance Engineering
11
Computer Language Benchmark Game

http://shootout.alioth.debian.org/u64q/which-programming-languages-are-fastest.php
12
Java (HotSpot) v.s. Java (Interpreter)

13
Java v.s. Fortran

14
Java v.s. GNU g++ (C++)

15
COBOL to Java

16
COBOL Program - Display File Contents
IDENTIFICATION DIVISION.
PROGRAM-ID. LST001.
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT F1 ASSIGN TO "C:\COBOL\LST001.CBL" STATUS FST.
DATA DIVISION.
FILE SECTION.
FD F1.
01 F1R PIC X(72).
WORKING-STORAGE SECTION.
01 FST PIC X(02).
PROCEDURE DIVISION.
OPEN INPUT F1
PERFORM UNTIL FST NOT = "00"
READ F1
END
CONTINUE
NOT END
DISPLAY F1R
END-READ
END-PERFORM
CLOSE F1
STOP RUN.

17
Java EE overview

18
Java EE Tiered Applications

•Client Tier
•Web Tier
•Business Tier
•EIS (Enterprise Information System) Tier

Client Web Business EIS

19
Client Tier

•Web Browsers
- HTML
- Java Applet
- AJAX

•Rich Client Applications


- Java Web Start Applications
- Desktop (Java) Client

20
Web Tier

•Web Server Applications


•Servlet
•JSF (JavaServer Faces)
•JSF Facelet
•EL (Expression Language)
•JSP (JavaServer Pages)
•JSP Standard Tag Library
•JavaBeans Components
21
Business Tier

•Enterprise JavaBeans
•JAX-RS RESTful Web Services
•JAX-WS Web Services Endpoints
•Java Persistence API

22
EIS Tier

•JDBC (Java Database Connection)


•Java Persistence API
•Java EE Connector Architecture
•Java Transaction API

23
Java EE 6 Technologies
• EJB 3.1 • JAXB 2.2 • Java Persistence 2.0
• Servlet 3.0 • JAXR 1.0 • Bean Validation 1.0
• JSP 2.2 • Java EE Management 1.1 • Managed Bean 1.0
• EL 2.2 • Java EE Deployment 1.2 • Interceptors 1.1
• JMS 1.1 • JACC 1.4 • Contexts and
Dependency Injection for
• JTA 1.1 • JASPIC 1.0 JavaEE 1.0

• JavaMail 1.4 • JSP Debugging 1.0 • Dependency Injection for


Java 1.0
• Connector 1.6 • JSTL 1.2
• Web Services 1.3 • Web Services Metadata
2.1
• JAX-RPC 1.1
• JSF 2.0
• JAX-WS 2.2
• Common Annotations 1.1
• JAX-RS 1.1
24
Future Topic Candidates

25
Future Topic Candidates

•Java EE Details
•Spring Framework
•Testing
•Source Code Management
•COBOL and Java ?
•...

26

Вам также может понравиться