To Java SE 8, and Beyond! Simon Ritter Technology Evangelist Twitter: #speakjava.

Slides:



Advertisements
Similar presentations
MVC in JavaEE 8 Manfred Riem Principal Member of Technical Staff September, 2014 Copyright © 2014, Oracle and/or its affiliates. All rights reserved.
Advertisements

Written by: Dr. JJ Shepherd
What iS RMI? Remote Method Invocation. It is an approach where a method on a remote machine invokes another method on another machine to perform some computation.
Nashorn: JavaScript on the JDK Jim Laskey Multi-language Lead, Language/Tools Group, Java Platform.
IntroductionIntroduction  Computer program: an ordered sequence of statements whose objective is to accomplish a task.  Programming: process of planning.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Principles of Object-Oriented Software Development The language Java.
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. | JSON Pointer and JSON Patch Updates to Java API for JSON Processing Kin-man Chung.
Copyright © 2014 Oracle and/or its affiliates. All rights reserved. | 2 Hidden Gems of APEX David Gale Software Engineer Oracle Application Express November,
The Safe Harbor The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated.
COMP 14: Intro. to Intro. to Programming May 23, 2000 Nick Vallidis.
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
2 2 The following is intended to outline our general product direction. It is intended for informational purposes only, and may not be incorporated into.
Lecture 1: Overview of Java. What is java? Developed by Sun Microsystems (James Gosling) A general-purpose object-oriented language Based on C/C++ Designed.
01 Introduction to Java Technology. 2 Contents History of Java What is Java? Java Platforms Java Virtual Machine (JVM) Java Development Kit (JDK) Benefits.
Copyright © 2015, Oracle and/or its affiliates. All rights reserved. JD Edwards Summit PaaS from an Applications Perspective Charles McGuinness Director,
Oracle Confidential – Internal/Restricted/Highly RestrictedCopyright © 2014, Oracle and/or its affiliates. All rights reserved. | Oracle Identity Management.
Java Software Solutions Lewis and Loftus Chapter 2 1 Copyright 1997 by John Lewis and William Loftus. All rights reserved. Software Concepts -- Introduction.
Principles of Programming Chapter 1: Introduction  In this chapter you will learn about:  Overview of Computer Component  Overview of Programming 
Principles of Computer Programming (using Java) Review Haidong Xue Summer 2011, at GSU.
Main sponsor. Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 2 Project Lambda: Functional Programming Constructs & Simpler Concurrency.
M1G Introduction to Programming 2 4. Enhancing a class:Room.
Sadegh Aliakbary Sharif University of Technology Fall 2011.
Software Construction Lecture 10 Frameworks
Copyright © 2014, Oracle and/or its affiliates. All rights reserved. An Auto-Join Network of Things Wong, H. and Wesson, B. Oracle Confidential – Internal/Restricted/Highly.
Sadegh Aliakbary Sharif University of Technology Fall 2012.
Advanced Programming Collage of Information Technology University of Palestine, Gaza Prepared by: Mahmoud Rafeek Alfarra Lecture 2: Major Concepts of Programming.
Chapter 1: Introducing JAVA. 2 Introduction Why JAVA Applets and Server Side Programming Very rich GUI libraries Portability (machine independence) A.
JAVA Java is a programming language and computing platform first released by Sun Microsystems in It was first developed by James Gosling at Sun Microsystems,
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Java Programming Presented by Daniel Rosenthal Friday, November 30 th, 2007.
Introduction to java Prepared By:-Pragnesh Patel Lect. In Computer Dept. NSIT,Jetalpur 1.
Mohsen Zainalpour What`s New in Java 8 JUG.
1. When things go wrong: how to find SQL error Sveta Smirnova Principle Technical Support Engineer, Oracle.
COSC617 Project XML Tools Mark Liu Sanjay Srivastava Junping Zhang.
Core Java Introduction Byju Veedu Ness Technologies httpdownload.oracle.com/javase/tutorial/getStarted/intro/definition.html.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 1.
RESTful Microservices In Java With Jersey Jakub Podlešák Software Engineer Oracle, Application Server Group September 29, 2014 Copyright © 2014, Oracle.
Introduction Mehdi Einali Advanced Programming in Java 1.
Today… “Hello World” ritual. Brief History of Java & How Java Works. Introduction to Java class structure. But first, next slide shows Java is No. 1 programming.
Design of A Custom Vector Operation API Exploiting SIMD Intrinsics within Java Presented by John-Marc Desmarais Authors: Jonathan Parri, John-Marc Desmarais,
Ada, Scheme, R Emory Wingard. Ada History Department of Defense in search of high level language around Requirements drafted for the language.
Sadegh Aliakbary Sharif University of Technology Fall 2010.
Copyright © 2013, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12 1.
© 2010 IBM Corporation RESTFul Service Modelling in Rational Software Architect April, 2011.
Lecture 5:Interfaces and Abstract Classes Michael Hsu CSULA.
JAVA TRAINING IN NOIDA. JAVA Java is a general-purpose computer programming language that is concurrent, class-based, object-oriented and specifically.
Java and C# - Some Commonalities Compile into machine-independent, language- independent code which runs in a managed execution environment Garbage Collection.
Lecture 6:Interfaces and Abstract Classes Michael Hsu CSULA.
Slide 1. What's New in NetBeans IDE 7.1 Name Title.
Lecture 5:Interfaces and Abstract Classes
Object Oriented Programming in
Internet and Java Foundations, Programming and Practice
Java 9 New features 8/11/2017 Iason Dimitrios Rodis.
CMPE419 Mobile Application Development
OpenWorld 2018 How to Create Chatbots with OMCe
Flight Recorder in OpenJDK
Functional Programming with Java
OpenWorld 2018 How to Combine Data from Source Sites
Oracle Database Multilingual Engine
OpenWorld 2018 Oracle API Platform: How to Manage Typical Workflows
Confidential – Oracle Internal/Restricted/Highly Restricted
Principal Product Manager Oracle Data Science Platform
Units with – James tedder
1.
(Computer fundamental Lab)
David Cleverly – Development Lead
CMPE419 Mobile Application Development
Oracle Java SE Subscriptions; Protect Your Investment in Java SE
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Presentation transcript:

To Java SE 8, and Beyond! Simon Ritter Technology Evangelist Twitter: #speakjava

The following 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.

? 2012

Priorities for the Java Platforms Grow Developer Base Grow Adoption Increase Competitiveness Adapt to change

6 6 Evolving the Language From “Evolving the Java Language” - JavaOne 2005 Java language principles – Reading is more important than writing – Code should be a joy to read – The language should not hide what is happening – Code should do what it seems to do – Simplicity matters – Every “good” feature adds more “bad” weight – Sometimes it is best to leave things out One language: with the same meaning everywhere No dialects We will evolve the Java language But cautiously, with a long term view “first do no harm” also “Growing a Language” - Guy Steele 1999 “The Feel of Java” - James Gosling 1997

How Java Evolves and Adapts Of the community, by the community, for the community JSR-348: JCP.next

JCP Reforms Developers’ voice in the Executive Committee SOUJava Goldman Sachs London JavaCommunity JCP starting a program of reform JSR 348: Towards a new version of the JCP

9 9 Java SE 7 Release Contents Java Language Project Coin (JSR-334) Class Libraries NIO2 (JSR-203) Fork-Join framework, ParallelArray (JSR-166y) Java Virtual Machine The DaVinci Machine project (JSR-292) InvokeDynamic bytecode Miscellaneous things JSR-336: Java SE 7 Release Contents

10 JVM Convergence

11 The (Performance) Free Lunch Is Over Image courtesy of Herb Sutter

SPARC T1 (2005) 8 x 4 = 32 SPARC T2 (2007) 8 x 8 = 64 SPARC T3 (2011) 16 x 8 = 128

13 Multi-core Clients Phone... Tablet... Desktop 2012

14 Big Disclaimer The syntax used in the following slides may change Caveat emptor

class Student { String name; int gradYear; double score; } Collection students =...;

double max = Double.MIN_VALUE; for (Student s : students) { if (s.gradYear == 2011) max = Math.max(max, s.score); }

Collection students =...; double max = Double.MIN_VALUE; for (Student s : students) { if (s.gradYear == 2011) max = Math.max(max, s.score); }

Collection students =...; max = students.filter(new Predicate () { public boolean op(Student s) { return s.gradYear == 2011; } }).map(new Extractor () { public Double extract(Student s) { return s.score; } }).reduce(0.0, new Reducer () { public Double reduce(Double max, Double score) { return Math.max(max, score); } });

Inner Classes Are Imperfect Closures Bulky syntax Unable to capture non-final local variables Transparency issues Meaning of return, break, continue, this No non-local control flow operators

Single Abstract Method (SAM) Types Lots of examples in the Java APIs Runnable, Callable, EventHandler, Comparator Noise:Work ratio is 5:1 Lambda expressions grow out of the idea of making callback objects easier foo.doSomething(new CallbackHandler() { public void callback(Context c) { System.out.println(c.v()); } });

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);

22 Lambda Expression Examples (Context c) -> System.out.println(c.v()); c -> System.out.println(c.v()); // Inferred int x -> x + 1

Target Types Rule #1: Only in a context where it can be converted to a SAM type 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

Lambda Bodies Rule #2: A list of statements just like in a method body, except no break or continue at the top level. The return type is inferred from the unification of the returns from the set of return statements Rule #3: ‘this’ has the same value as ‘this’ immediately outside the Lambda expression Rule #4: Lambdas can use‘effectively final’ variables as well as final variables (compiler inferred)

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();... }

How to extend an interface in Java SE 8 public interface Set extends Collection { public int size();... // The rest of the existing Set methods public extension T reduce(Reducer r) default Collections. setReducer; } tells us this method extends the interface Implementation to use if none exists for the implementing class

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 extension Collection filter(Predicate p) default Collections. filter; extension Collection map(Extractor e) default Collections. map; extension V reduce() default Collections. reduce; }

$ java org.planetjdk.aggregator.Main

$ 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

$ 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

module 1.0 { requires 1.0; requires 1.2; requires 1.0; requires 1.0; requires 1.6; requires 1.4.4; class org.openjdk.aggregator.Main; } module-info.java

jdom-1.0 jaxen-1.0 saxpath-1.0 rome-1.0 joda-time-1.6 tagsoup-1.2 jaxp org.planetjdk.aggregator rome-fetcher-1.0

classpath

deb rpm jar jmod mvn // module-info.java module 1.0 { requires 1.0; requires 1.2; requires 1.0; requires 1.0; requires 1.6; requires 1.4.4; class org.openjdk.aggregator.Main; }

classpath

Java SE Profiles and Modules Rules for creating modules of the Java SE platform Java SE base profile Java SE base module Component modules for separable technologies

JDK 8 – Proposed Content

Additional Disclaimers Some ideas for the Java Platform are shown on the following slides Large R&D effort required Content and timing highly speculative Some things will turn out to be bad ideas New ideas will be added Still, Java’s future is bright (in our humble opinion)!

Java SE 9 (and beyond…)

Vision: Interoperability Improved support for non-Java languages Invokedynamic (done) Java/JavaScript interop (in progress – JDK 8) Meta-object protocol (JDK 9) Long list of JVM optimizations (JDK 9+) Java/Native Calls between Java and Native without JNI boilerplate (JDK 9)

Vision: Cloud Multi-tenancy (JDK 8+) Improved sharing between JVMs in same OS Per-thread/threadgroup resource tracking/management Hypervisor aware JVM (JDK 9+) Co-operative memory page sharing Co-operative lifecycle, migration

Vision: Language Features Large data support (JDK 9) Large arrays (64 bit support) Unified type system (JDK 10+) No more primitives, make everything objects Other type reification (JDK 10+) True generics Function types Data structure optimizations (JDK 10+) Structs, multi-dimensional arrays, etc Close last(?) performance gap to low-level languages

Vision: Integration Modern device support (JDK 8+) Multitouch (JDK 8) Location (JDK 8) Sensors – compass, accelerometer, temperature, pressure,... (JDK 8+) Heterogenous compute models (JDK 9+) Java language support for GPU, FPGA, offload engines, remote PL/SQL...

The Path Forward Open development Prototyping and R&D in OpenJDK Cooperate with partners, academia, greater community Work on next JDK, future features in parallel 2-year cycle for Java SE releases

Java SE 2012 to Java JDK JDK JDK 8 JDK 9 JDK 10 JDK JVM convergence Mac OS X JVM convergence Mac OS X

Conclusions The Java platform will continue to evolve Java SE 8 will add some nice, big features Expect to see more in Java SE 9 and beyond Java is not the new Cobol

Further Information Project Lambda openjdk.java.net/projects/lambda Project Jigsaw openjdk.java.net/projects/jigsaw