the forces driving java

66
Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 1 The Forces Driving Java Steve Elliott Oracle UK November 2012

Upload: steve-elliott

Post on 10-May-2015

2.778 views

Category:

Technology


1 download

DESCRIPTION

Presentation for London Java Community Open Conference. 22nd November 2012. Steve Elliott - Oracle UK.

TRANSCRIPT

Page 1: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 1

The Forces Driving Java

Steve Elliott Oracle UK November 2012

Page 2: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 2

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.

Page 3: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 3

Page 4: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 4

The Highlander Fallacy

“There can be only one”

Page 5: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 5

The Highlander Fallacy

“This, of course, is a classic example of what I have called the Highlander Fallacy, which briefly stated is the principle that there can be only one. If any two technologies can be described using the same set of words, then there is no need for both of them, and only one will survive. I call this a fallacy because, to use a technical term, it is total crap.”

Jim Waldo http://blogs.law.harvard.edu/waldo

“There can be only one”

Page 6: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 6

“If someone claims to have the perfect programming language, he is either a fool, a salesman or both” “There are only two kinds of programming languages : those people complain about and those nobody uses” “ How do you pronounce ‘Bjarne Stroustrup’ ? It can be difficult for non-Scandinavians. The best suggestion I heard yet was “start by saying it a few times in Norwegian then stuff a potato down your throat and do it again” J

Bjarne Stroustup

Page 7: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 7

"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning." - Rick Cook

Page 8: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 8

http://www.junauza.com/2010/12/top-50-programming-quotes-of-all-time.html

Page 9: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 9

C

Cloud

Cloud

Cloud

Embedded Mobile Devices

Developer Tools CI DevOps

Concurrency Threads

JVM

Language Evolution Polyglot Programming

Performance Monitoring Management Tuning

Big Data NoSQL Modularity

Deployment

Web Technologies User

Interface

Community Governance Open Source

Hardware Evolution

Multi-tenancy

Page 10: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 10

Hardware Evolution

§ Pipelining, Superscalar, OoO execution… § Multi Core, Hyperthreading, Crypto… § Caches, Memory Hierarchy / Disk / SSD… § GPU processing § Networking § etc etc etc

Page 11: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 11

Hardware Evolution

§  Herb Sutter –  The free lunch is over –  Welcome to the jungle

§  Jason Robert Carey Patterson –  Modern Microprocessors – A 90 minute guide

§  Ulrich Drepper –  What every programmer should know about memory

§  Cliff Click –  A crash course in modern hardware

§  Martin Thompson (Mechanical Sympathy), Peter Lawrey, Kirk Pepperdine, Jevgeni Kabanov (Do you really get memory?) and many more…

Know your system

Page 12: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 12

Why Lambdas for Java?

Page 13: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 13

Page 14: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 14

Page 15: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 15

Language Evolution / Polyglot Programming

Page 16: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 16

Page 17: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 17

Influences on Java (née GreenTalk/Oak : 1991-92)

57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 00 01 02 03 04 05 06 07 08 09 10 11 12

Fortran

LISP

Clojure

Pascal (p-code)

Perl

C

PL/M Smalltalk

Java

occam

BASIC

Ruby

Scala

Coral

Algol

Ada

BCPL

Forth

Simula Modula

C++ Scheme

Objective C

Erlang

Haskell Python

http://en.wikipedia.org/wiki/Timeline_of_programming_languages http://hopl.murdoch.edu.au/

VB

PHP

Groovy

LiveScript/JavaScript

Dart

Go

Mesa Cedar

B

Self (Hotspot)

Kotlin

Ceylon

Fantom

TypeScript

Page 18: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 18

Page 19: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 19

The Da Vinci Machine Project Polyglot Programming

Nashorn Ceylon

Seph

Virtual Machine InvokeDynamic

Page 20: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 20

Project Nashorn

Page 21: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 21

Page 22: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 22

Page 23: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 23

Performance

§  JVM § Throughput / Latency § Monitoring / Instrumentation § Tuning § …

Page 24: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 24

Page 25: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 25

G1 – Garbage First

§ Supported for production use since 7u4 § Large heaps with GC latency requirements

–  Typically ~6GB or larger heaps –  Stable and predictable GC latencies below 0.5 seconds

§ Applications that have –  more than 50% live data on the heap –  varied object allocation rate –  undesired long GC or compaction pauses (greater than 0.5s)

Recommended Use Cases

Page 26: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 26

Performance Features

§ Partial Permanent Generation removal in JDK 7 –  Interned Strings moved to Java heap

§ First step: Full removal in JDK 8 § My be necessary to adjust GC tuning

–  Interned Strings now in heap –  Applications with high GC time –  Applications with high interned String count –  Larger heap size may be needed

HotSpot JVM: Partial Perm Gen Removal

Page 27: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 27

Java Diagnostic Commands

§ Complete tool chain –  Framework for easy implementation and integration –  Command line tool, jcmd

§  jcmd –  List running Java processes

§  jcmd <pid> help –  List all available commands, currently ~15 different commands

JDK Introspection

Page 28: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 28

Page 29: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 29

Modularity / Deployment

§ Modules –  Jigsaw –  OSGi –  Project Penrose

§ Deployment –  Enterprise, Web, App Store model

§ Build Systems / CI / Devops… –  Maven, Gradle, Hudson etc

Page 30: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 30

Page 31: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 31

Page 32: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 32

Page 33: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 33

Page 34: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 34

Page 35: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 35

Page 36: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 36

Page 37: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 37

UI / Web

§  JavaFX § Websocket / JSON (Java EE) § HTML5 § Mobile

Page 38: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 38

JavaFX Update

JavaFX 2.2 for Linux Scene Builder 1.0

Linux Developer Preview

JavaFX 2.1 for OS X

OpenJFX project created

Dec 11

NetBeans 7.2 with FX 2.1 and Scene Builder integration

Linux/ARM Dev Preview Scene Builder Linux Dev Preview

Jan 12 Apr 12 Aug 12

Page 39: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 39

Avatar

•  Applications based on Thin Server Architecture •  Incubator for HTML5/JavaScript clients with Java EE

–  Learn by experimenting –  Identify targets for standardization, e.g. WebSocket (now), Server-

Sent Event (Future)

•  End-to-end framework: Client and Server – A-la-carte, not all or nothing

Page 40: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 40

Introducing Project Easel – Advanced Tooling for HTML 5

•  Provides the foundation for tooling support for Project Avatar.

•  Consume Java EE based services with today’s popular JavaScript frameworks

Page 41: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 41

Java EE

JPA JAX-RS

SSE WebSocket

EL . . .

Angry Bids Demo

Auction Items

HTM

L5 Server

Infrastructure

Live Bid

Chat

HTTP restModel

Server-Sent Event pushModel

WebSocket socketModel

Database

Page 42: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 42

Page 43: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 43

http://spoofzu.blogspot.co.uk

Page 44: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 44

Page 45: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 45

Page 46: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 46

http://www.oracle.com/technetwork/java/seccodeguide-139067.html

Page 47: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 47

Roadmaps

Page 48: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 48

Page 49: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 49

JDK 8 Java for Everyone •  Profiles for constrained devices •  JSR 310 - Date & Time APIs •  Non-Gregorian calendars •  Unicode 6.1 •  ResourceBundle. •  BCP47 locale matching •  Globalization & Accessibility

Innovation •  Lambda aka Closures •  Language Interop •  Nashorn

Core Libraries •  Parallel operations for core

collections APIs •  Improvements in functionality •  Improved type inference

Security •  Limited doPrivilege •  NSA Suite B algorithm support •  SNI Server Side support •  DSA updated to FIPS186-3 •  AEAD JSSE CipherSuites

Tools •  Compiler control & logging •  JSR 308 - Annotations on

Java Type •  Native app bundling •  App Store Bundling tools

Client •  Deployment enhancements •  JavaFX 8 •  Public UI Control API •  Java SE Embedded support •  Enhanced HTML5 support •  3D shapes and attributes •  Printing

General Goodness •  JVM enhancements •  No PermGen limitations •  Performance lmprovements

Page 50: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 50

Page 51: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 51

JavaFX 2.2 and Beyond

Multi-Touch Mac

Scene Builder Advanced Cells

1080p Embedded

Performance

Rich Text

ComboBox

HTTP Live Streaming

Pagination

3D Native Deployment

h.264

Snapshot Canvas

Writeable Image

ColorPicker

i18n

Linux Printing

Accessibility 3rd Party Controls

SWT for Linux

ARM

Complex Text

SwingNode

Page 52: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 52

To Java SE 9 and Beyond!

Jigsaw

Cloud

Ease of use Optimizations Generic Lang Interoperability

Penrose

OpenJFX Project Sumatra – Java for GPUs

Ports: Power PC/AIX

Multi-Tenancy Support

Self Tuning JVM

Improved Integration with Native

Resource Management Lang Enhancements

Unified Type System Data Structure Optimizations

Page 53: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 53

Roadmap Java SE

2015 2012 2013 2014

7u6 •  JRE on Mac complete •  JavaFX 2.2 integration •  Linux ARM V6/V7 •  JavaFX on Mac and Linux

JDK 8 •  Lambda •  Complete JVM Convergence •  JavaScript Interop •  JavaFX 8

–  Public UI Control API –  Java SE Embedded support –  Enhanced HTML5 support

NetBeans IDE 7.2 •  Support for JDK 7 on Mac •  Support for JavaFX on

Mac and Linux

Scene Builder 1.0 •  Windows and Mac

Major Serviceability improvements •  Java Flight Recorder in JDK •  Native memory tracking •  Java Discovery Protocol •  App Stores Packaging tools •  Last Public Release of JDK 6

JDK 9 •  Jigsaw •  Interoperability •  Optimizations •  Cloud •  Ease of Use •  JavaFX JSR

NetBeans IDE 7.3 •  Scene Builder 1.1 support

Scene Builder 1.1 •  Linux support

NetBeans IDE 8 •  JDK 8 support •  Scene Builder 2.0 support

Scene Builder 2.0 •  JavaFX 8 support •  Enhanced Java IDE support

NetBeans IDE 9 •  JDK 9 support •  Scene Builder 3.0 support

SceneBuilder 3.0 •  JavaFX 9 support

Page 54: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 54

Roadmap Embedded Java

2015 2012 2013 2014

Java Embedded Suite 7 •  SE Embedded 7 •  GlassFish for Embedded •  Java DB

Java SE Embedded 8 •  Complete JVM convergence •  Additional compact profiles •  JavaFX for Embedded

Java Embedded Suite 8 •  Additional enterprise middleware integrations

•  Flight Recorder/Mission Control

Java ME Embedded 3.2 •  Microcontroller support •  Device Access APIs

Java ME SDK 3.2 •  Embedded emulator •  Eclipse integration

Java Embedded Suite 7.1 •  Sync with latest JDK and

GlassFish •  Optimizations and additional

platform support

Java Embedded 9 •  JDK9 •  Modularity based on

Jigsaw •  Additional Embedded

device APIs •  Ease of Development

Java ME Embedded 3.3 •  Enhanced device access •  Footprint optimization &

configuration tools •  Improved developer

tooling & experience

Java ME Embedded 8 •  Java ME 8 •  Standardized Embedded API •  New on-device debugging

architecture NetBeans IDE 8 •  Java ME/SE 8 Embedded

support

NetBeans IDE 7.2 •  ME Embedded support

NetBeans IDE 9 •  Java ME/SE 9

Embedded support •  Jigsaw support

Page 55: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 55

Java EE Past, Present, & Future

May 1998

Enterprise Java Platform

Dec 1999 10 specs

Robustness

Sep 20110 13 specs

Web Services

Nov 2003 20 specs

Ease of Development

May 2006 23 specs

Lightweight

Dec 2009 28 specs

Simplicity & HTML5

Q2 2013 33+ specs

JPE Project

J2EE 1.3 CMP, Connector Architecture

Java EE 5 Ease of Development, Annotations, EJB 3.0, JPA, JSF, Updated Web Services

J2EE 1.4 Web Services Mgmt, Deployment, Async Connector

Java EE 6 Pruning, Extensibility Ease of Dev, CDI, JAX-RS

Web Profile

Servlet 3.0, EJB 3.1 Lite

Java EE 7 JMS 2.0, Batch, JCache, TX Interceptors HTML5: WebSocket, JSON

Web Profile

JAX-RS 2.0

J2EE 1.2 Servlet, JSP, EJB, JMS RMI/IIOP

Page 56: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 56

Page 57: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 57

Page 58: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 58

Page 59: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 59

Java EE 7 – Candidate JSRs

Connector 1.6

Managed Beans 1.0 EJB 3.2

Servlet 3.1

Portable Extensions

JSF 2.2 JAX-RS 2.0

Bea

n Va

lidat

ion

1.1

JMS 2.0 JPA 2.1

EL 3.0

JTA 1.2

JSP 2.2

Interceptors 1.1 CDI 1.1 Common Annotations 1.1

Updated Major Release

New

Java Caching API (JSR 107)

Batch Applications (JSR 352)

Java API for JSON (JSR 353)

Java API for WebSocket (JSR 356)

Page 60: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 60

Connector 1.6

Managed Beans 1.0 EJB 3.2

Servlet 3.1

Portable Extensions

JSF 2.2 JAX-RS 2.0

Bea

n Va

lidat

ion

1.1

JMS 2.0 JPA 2.1

EL 3.0

JTA 1.2

JSP 2.2

Interceptors 1.1 CDI 1.1 Common Annotations 1.1

Java Caching API (JSR 107)

Batch Applications (JSR 352)

Java API for JSON (JSR 353)

Java API for WebSocket (JSR 356)

Java EE 7 – Specification Status

✔ Early/Public Drafts Available

✔ ✔ ✔

✔ ✔

Page 61: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 61

4.0 Java EE 7 – Implementation Status

download.java.net/glassfish/4.0/promoted/

Page 62: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 62

Java EE 8 and beyond

§ Deliver cloud architecture

§ Multi tenancy for SaaS applications

§  Incremental delivery of JSRs

§ Modularity based on Jigsaw (SE 9)

Standards-based cloud programming model

Java EE 7

PaaS Enablement

Multi- tenancy

NoSQL

JSON-B

State Management Avatar

Concurrency

Storage

Page 63: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 63

Page 64: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 64

Page 65: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 65

References § Herb Sutter

–  http://www.gotw.ca/publications/concurrency-ddj.htm –  http://herbsutter.com/welcome-to-the-jungle

§  Jason Robert Carey Patterson –  http://www.lighterra.com/papers/modernmicroprocessors

§ Ulrich Drepper –  http://lwn.net/Articles/250967

§ Cliff Click –  http://www.infoq.com/presentations/click-crash-course-modern-hardware

§  James Gosling –  http://dl.acm.org/citation.cfm?id=620728

Page 66: The Forces Driving Java

Copyright © 2012, Oracle and/or its affiliates. All rights reserved. 66

Acknowledgments § Much of the content of this presentation is taken from various

JavaOne and Oracle OpenWorld 2012 slide decks. § Thanks to..

Hasan Rizvi, Georges Saab, Henrik Stahl, Nandini Ramani, Cameron Purdy, Mark Reinhold, Brian Goetz, Richard Bair, ArunGupta, Simon Ritter, Tomas Nilsson, Marcus Lagergren, Marcus Hirt, Staffan Friberg, David Keenan, Scott Kovatch, John Clingan, John Rose, Milton Smith, Joe Darcy, Stuart Marks…and anybody else I missed.

§ Thanks also.. –  James Gosling – ‘The Feel of Java’ and a lot more J –  John Rose / JVM Languages Summit – ‘Vitruvian Duke’ graphic –  Jim Waldo – ‘Highlander Fallacy’ reference –  Bjarne Stroustup - quotes –  http://www.junauza.com/2010/12/top-50-programming-quotes-of-all-time.html