Upload
jax-london
View
9.688
Download
1
Embed Size (px)
DESCRIPTION
2011-11-02 | 01:30 PM-02:15 PM With the recent release of Java SE 7 the Java platform is back on the move, addressing the needs of developers as platforms and applications change. This session will briefly recap recent developments in Java SE 7 and the Java Community Process before moving onto the current ideas for features in Java SE 8. Discussions are underway within Oracle about the main themes for Java SE 9 and beyond. We'll conclude with an open discussion around what features the audience would like to see included in future releases of the Java platform. Key points from this will be passed back to Java SE product management in Oracle.
Citation preview
2. To Java SE 8, and Beyond! Simon Ritter Technology Evangelist 3. 8 9 2020? 2012 4. Priorities for the Java Platforms Grow Developer Base Grow Adoption Increase Competitiveness Adapt to change 5. Evolving the Language From Evolving the Java Language - JavaOne 2005
also Growing a Language - Guy Steele 1999 The Feel of Java - James Gosling 1997 6. How Java Evolves and Adapts Of the community, by the community, for the community JSR-348: JCP.next 7. JCP Reforms
8. Java SE 7 Release Contents
9. JVM Convergence 10. The (Performance) Free Lunch Is Over Image courtesy of Herb Sutter 11. SPARC T1(2005) 8 x 4 = 32 SPARC T2(2007) 8 x 8 = 64 SPARC T3 (2011) 16 x 8 = 128 12. Multi-core Clients 2002 2004 2006 2008 2010 2...4.....8..... Phone ... Tablet ... Desktop 2012 13. BigDisclaimer The syntax used in the following slides may change Caveat emptor 14. class Student {String name;int gradYear;double score; } Collection students = ...; 15. Collection students = ...; double max = Double.MIN_VALUE; for (Student s : students) { if (s.gradYear == 2011) max = Math.max(max, s.score); } 16. Collection students = ...; double max = Double.MIN_VALUE; for (Student s :students ) { if ( s.gradYear == 2011 ) max =Math.max (max,s.score ); } 17. Collection students = ...; max = students. filter (new Predicate() { public boolean op(Student s) { returns.gradYear == 2010 ; } }). map (new Extractor() { public Double extract(Student s) { returns.score ; } }). reduce (0.0, new Reducer() { public Double reduce(Double max, Double score) { returnMath.max (max,score ); } }); 18. Inner Classes Are Imperfect Closures
19. Single Abstract Method (SAM) Types
foo.doSomething(new CallbackHandler() {public void callback(Context c) {System.out.println(c.v()); } } ); 20. Collection students = ...; max = students. filter ((Student s)-> s.gradYear == 2011 ) . map ((Student s)-> s.score ) . reduce (0.0,(Double max, Double score)-> Math.max (max, score)); max = students. filter (s-> s.gradYear == 2011 ) . map (s-> s.score ) . reduce (0.0,Math # max ); max = students. parallel () . filter (s-> s.gradYear == 2011 ) . map (s-> s.score ) . reduce (0.0,Math # max ); 21. Lambda Expression Examples (Context c) -> System.out.println(c.v()); c -> System.out.println(c.v());// Inferred int x -> x + 1 22. Target Types
CallBackHandler cb =(Context c) -> System.out.println(c.v()); x -> x + 1; Runnable r = () -> System.out.println("Running); executor.submit(() -> System.out.println("Running)); Object o = () -> 42;// Illegal, not a SAM type 23. Lambda Bodies
24. Collection students = ...; double max =// Lambda expressions students .filter (Students s-> s.gradYear == 2010 }) .map (Students s-> s.score }) .reduce (0.0,Math # max ); interface Collection { int add(T t); int size(); void clear(); ... } 25. How to extend an interface in Java SE 8 public interface Set extends Collection { public int size(); ...// The rest of the existing Set methods publicextensionT reduce(Reducer r) defaultCollections.setReducer; } tells us this method extends the interface Implementation to use if none exists for the implementing class 26. Collection students = ...; double max =// Lambda expressions students .filter (Students s ->s.gradYear == 2010 ) .map (Students s ->s.score ) . reduce (0.0,Math # max ); interface Collection {// Default methods extensionCollectionfilter (Predicate p) defaultCollections. filter ; extension Collectionmap (Extractor e) defaultCollections. map ; extension Vreduce () defaultCollections. reduce ; } 27. $ java org.planetjdk.aggregator.Main 28. $ java -cp $APPHOME/lib/ jdom-1.0.jar: $APPHOME/lib/jaxen-1.0.jar: $APPHOME/lib/saxpath-1.0.jar: $APPHOME/lib/rome.jar-1.0.jar: $APPHOME/lib/rome-fetcher-1.0.jar: $APPHOME/lib/joda-time-1.6.jar: $APPHOME/lib/tagsoup-1.2.jar: org.planetjdk.aggregator.Main 29. $java -cp $APPHOME/lib/ jdom-1.0.jar : $APPHOME/lib/ jaxen-1.0.jar : $APPHOME/lib/ saxpath-1.0.jar : $APPHOME/lib/ rome.jar-1.0.jar : $APPHOME/lib/ rome-fetcher-1.0.jar : $APPHOME/lib/ joda-time-1.6.jar : $APPHOME/lib/ tagsoup-1.2.jar : org.planetjdk.aggregator.Main 30. module-info.java module org.planetjdk.aggregator @ 1.0 { requires jdom @ 1.0; requires tagsoup @ 1.2; requires rome @ 1.0; requires rome-fetcher @ 1.0; requires joda-time @ 1.6; requires jaxp @ 1.4.4; class org.openjdk.aggregator.Main; } 31. jdom-1.0 jaxen-1.0 saxpath-1.0 rome-1.0 joda-time-1.6 tagsoup-1.2 jaxp-1.4.4 org.planetjdk.aggregator rome-fetcher-1.0 32. classpath 33. deb rpm jar jmod mvn // module-info.java module org.planetjdk.aggregator @ 1.0 { requires jdom @ 1.0; requires tagsoup @ 1.2; requires rome @ 1.0; requires rome-fetcher @ 1.0; requires joda-time @ 1.6; requires jaxp @ 1.4.4; class org.openjdk.aggregator.Main; } 34. classpath http://www.flickr.com/photos/thatguyfromcchs08/2300190277 h ttp://www.flickr.com/photos/viagallery/2290654438 35. Java SE Profiles and Modules
36. JDK 8 Proposed Content 37. Additional Disclaimers
38. Java SE 9 (and beyond) 39. Vision: Interoperability
40. Vision: Cloud
41. Vision: Language Features
42. Vision: Integration
43. The Path Forward
44. Java SE 2012 to Java 12 2011 2015 2019 2014 JDK 7 2013 2021 JDK 12 2017 JDK 8 JDK 9 JDK 10 JDK 11 2012 JVM convergence Mac OS X 45. Conclusions
46. Further Information
47. The preceding is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle s products remains at the sole discretion of Oracle. 48.