15

Click here to load reader

2013 05 java 7 brown bag part 1 - new features and migration strategy

Embed Size (px)

DESCRIPTION

Overview of new features in Java 7, including code examples, and suggested outline migration (upgrade) strategy.

Citation preview

Page 1: 2013 05 java 7 brown bag part 1 - new features and migration strategy

New Features and Migration Strategy

Neil Brown, 04/2013

- Brown Bag, Part 1 -

Page 2: 2013 05 java 7 brown bag part 1 - new features and migration strategy

Java Standard Edition (JSE) - Today

Page 3: 2013 05 java 7 brown bag part 1 - new features and migration strategy

JSE, Today

● J6 end-of-life'd by Oracle 02-2013, but...

...there's life after J6:

● J7 mature - first GA (prod. ready) 07-2011 ● J8 descoped (Jigsaw) and slipped (end

2012, 09-2013). Latest plan GA 03-2014

Page 4: 2013 05 java 7 brown bag part 1 - new features and migration strategy

The Business Case

Page 5: 2013 05 java 7 brown bag part 1 - new features and migration strategy

J7 - The Business Case

● Maintenance & security updates from Oracle until at least 07-2014

● Performance improvements, translating to better response times & throughput○ HotSpot JVM enhancements○ Improved concurrency support

● New features to keep dev team :-) and more productive○ Prerequisite / enabler for JEE7

Page 6: 2013 05 java 7 brown bag part 1 - new features and migration strategy

New & Changed Features - Highlights

Page 7: 2013 05 java 7 brown bag part 1 - new features and migration strategy

J7 - HighlightsTargets improved performance & readability● Java language enhancements (Project Coin)● Concurrency enhancements (Fork/Join)● New File I/O (NIO.2)● XML APIs (JAXP, JAXB, JAX-WS) updated● Platform (JVM) enhancements

○ HotSpot JVM performance improvements○ Better support for dynamic lang. (invokedynamic)○ New 'G1' garbage collector for certain server apps

...and more. See Oracle JDK 7 Adoption Guide

Page 8: 2013 05 java 7 brown bag part 1 - new features and migration strategy

Migration - How do we get there?

Page 9: 2013 05 java 7 brown bag part 1 - new features and migration strategy

J7 - How do we get there?

In two phases:1. Prove runtime compatibility & stability for

existing services on J7 runtime (JVM) before...

2. Recompiling services to take advantage of new language features; (at which point we're committed to J7)

Page 10: 2013 05 java 7 brown bag part 1 - new features and migration strategy

Phase 1 Migration Plan - Overview

1. Prove binary backwards compatibility for JEE container & all Java services○ Local dev. environment○ Existing JEE container running on J7 JVM○ Services deployed to J7+container○ Unit and cursory integration tests pass

2. Prove behavioural compatibility for all Java services○ Install JDK 7 (JRE) in CI environment○ Execute integration test suites

Page 11: 2013 05 java 7 brown bag part 1 - new features and migration strategy

Phase 1 Migration Plan - Overview

3. Soak testing● Prove reliability over extended period

4. Performance testing● Confirm performance at least as good

5. Phased rollout J7 across remaining envs● Upgrade JDK / JRE (still J6 javac only)

6. Prove in production○ Services to run on J7 for agreed period before

declaring success and moving to phase 2 (J7 javac)

Page 12: 2013 05 java 7 brown bag part 1 - new features and migration strategy

Phase 1 Migration Status 04/2013

1. Prove binary backwards compatibility for JEE container & all Java services○ Local dev. environment ................................ ✔○ JEE container running on J7 JVM ............... ✔○ Services deployed to J7+container .............. ✔○ Unit and cursory integration tests pass ........ ✔

2. Prove behavioural compatibility for all Java services○ Install JDK 7 (JRE) in CI environment ........ ✍○ Execute integration test suites .................... ✍

Page 13: 2013 05 java 7 brown bag part 1 - new features and migration strategy

Language Enhancements(Project Coin)

Page 14: 2013 05 java 7 brown bag part 1 - new features and migration strategy

New Language Features● Diamond operator

○ Type inference for generic types● Multi-catch blocks

○ Improved exception handling● Automatic resource management

○ aka try-with-resources● Switch on strings

○ Enhanced switch statement● Binary literals

○ Integer types expressed in binary

Page 15: 2013 05 java 7 brown bag part 1 - new features and migration strategy

New Language Features

● Underscores in integer and binary literals○ Increased code readability

Java 7 code examples● https://bitbucket.org/neilbrown/java7-examples

Thanks for attendingNeil Brown