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
Java and Java EE Future Tao Li Technology Evangelist [email protected] Sun Microsystems Agenda •Language and platform Wars •Java Runtime Improvement •Java EE Improvement JavaScript Java Python Language Wars Ruby Perl Micro Case Study: s1 is a string variable containing “1” n2 is an integer variable containing 2 To do: compute a string named s12 with the values concatenated, and an integer named n3 with the values added. D12.java class D12 { public static void main(String args[]) { String s1 = "1"; int n2 = 2; String s12 = s1 + Integer.toString(n2); int n3 = Integer.parseInt(s1) + n2; System.out.println("s12: " + s12 + ", n3: " + n3); } } D12.pl $s1 = '1'; $n2 = 2; $s12 = $s1 . $n2; $n3 = $s1 + $n2; print "s12: $s12, n3: $n3\n"; D12.py s1 = '1' n2 = 2 s12 = s1 + str(n2) n3 = int(s1) + n2 print "s12: " + s12 + ", n3:", n3 D12.rb s1 = "1" n2 = 2 s12 = s1 + n2.to_s n3 = s1.to_i + n2 puts "s12: " + s12 + ", n3: " + n3.to_s Comparison Java Perl Python Ruby Lines 11 5 5 5 Characters 240 85 88 93 What’s a Modern Language? •It’s Object-Oriented. •You don’t do memory management. •Runs on some sort of VM. Dynamic Language advantage •Each statement does more work. •You don’t have to declare variables. •Variables can hold different types. •Precompilation is not required. •So, the same amount of work with less code! Dynamic-Language Scorecard •JavaScript: hot because of AJAX •Perl: currently too ugly, blocked waiting for Perl6 •Python: large community, lots of production apps •Ruby: great language, recently got a community because of Rails Why Not Dynamic Languages? 1.No static typing, so it’s unsafe and buggy, just like bad old C code. 2.It doesn’t run on the JVM, so it’s hard to integrate with existing apps. Static Typing is Overrated! Static typing prevents certain failures but, in so doing, it prevents certain types of successes. - Sean McGrath Static Typing is Overrated! Test-Driven Development produces the same level of safety as compile-time static type checking. - Bruce Eckel, Paul Graham, Robert C. Martin, many others... Why Not Dynamic Languages? 1.No static typing, so it’s unsafe and buggy, just like bad old C code. 2.It doesn’t run on the JVM, so it’s so hard to integrate with existing apps. Big problem! Java’s Advantages 1.Static typing gives the IDE a lot of help, so that even if you have to write more code, it might not take any longer. 2.Compile-time type knowledge allows faster dispatching than “duck typing”. 3.More memory-efficient. 4.Real threads. Should you choose Java Programming language? There is no best choice, but most appropriate! Parrot Java Platform Wars .NET The Java Platform (Today) JVM Java Language APIs A Future Java Platform Java Ruby JVM JavaScript Python etc... APIs Example: Servlets With Jython JSR 223 •No deployment •Full access to Java APIs •Full access to Python APIs •Interactive testing •Fast development Why the Java Platform Can Win •Installed base •Performance •Multithreading •Libraries Java Runtime Improvement What does the JRE look like now? 25 But... 26 Java SE 6 Update N • Java 6 update, targets easier, better and faster end-user distribution > First half of 2008 • • • • • Improved installer Java Technology Deployment Kit Highly modularized Quick start service Better default Look & Feel 27 Modularization • Minimum initial size – about 2M > basic functions needed by every program • Download the rest of JRE in parallel • Missing components will be downloaded on demand 28 Estimated Runtime Sizes 29 Java Technology Deployment Toolkit Technologies for detecting and deploying Java • JavaScript APIs > Hosted by Sun @ http://java.com/js/deployJava.js • Browser Plugins • Stand alone executable > getjava.exe 30 Java Quick Start Service • Background process which periodically reads from JRE files, keeps them in the disk cache • With files in disk cache, it becomes Warm Start • Doesn't really consume memory: it is in the disk cache • Automatically shutdown on Memory Constrained systems 31 Java EE Improvement History of Java Enterprise Platform Ease of Development Java EE5 Web Services Enterprise Java Platform J2EE 1.2 JPE Project May 1998 Robustness J2EE 1.3 EJB 2.0, Connector Architecture J2EE 1.4 Web Services, Management, Deployment, Async. Connector Annotations, EJB 3.0, Persistance API, JSF, Renewed Web Services Servlet, JSP, EJB, JMS, JTA, JNDI, RMI/IIOP Dec 1999 Sept. 2001 Nov. 2003 May 2006 Java EE 5 • Ease of development > POJO Programming > Annotation > Resource Injection • JPA > New persistence model replaced Entity Bean • JSF > New component based MVC framework • JAX-WS and JAXB 2.0 Java EE 6 • Rightsizing > Profiles: The Web Profile, a subset of the platform focussed on Web Applications • Further ease of development > Java EE 5 - EJB simplifications > Java EE 6 Web Tier and packaging simplifications • Extensibility > Allowing for Open Source Frameworks to be plugged in via a standard mechanism “Java EE 6 will be the most important release of the platform since it was released 10 years ago” -- Rod Johnson, Inventor of Spring Java and Java EE Future Tao Li Technology Evangelist [email protected] Sun Microsystems