Real World Java 9

trishagee 2,094 views 71 slides Jun 26, 2017
Slide 1
Slide 1 of 71
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26
Slide 27
27
Slide 28
28
Slide 29
29
Slide 30
30
Slide 31
31
Slide 32
32
Slide 33
33
Slide 34
34
Slide 35
35
Slide 36
36
Slide 37
37
Slide 38
38
Slide 39
39
Slide 40
40
Slide 41
41
Slide 42
42
Slide 43
43
Slide 44
44
Slide 45
45
Slide 46
46
Slide 47
47
Slide 48
48
Slide 49
49
Slide 50
50
Slide 51
51
Slide 52
52
Slide 53
53
Slide 54
54
Slide 55
55
Slide 56
56
Slide 57
57
Slide 58
58
Slide 59
59
Slide 60
60
Slide 61
61
Slide 62
62
Slide 63
63
Slide 64
64
Slide 65
65
Slide 66
66
Slide 67
67
Slide 68
68
Slide 69
69
Slide 70
70
Slide 71
71

About This Presentation

The latest version of the Java 9 talk, shown at GOTO Amsterdam and JBCN Conf


Slide Content

Real World Java 9

Real World Java 9 Jigsaw in Action Reactive Programming in Java 9 The Other Good Stuff

Why Java 9?

Free Lunch! Better Use of Memory Better Performance of: Locking Secure Apps Graphics Better Use of Hardware Better Documentation Prettier Graphics (Windows and Linux) Faster Compilation

Jigsaw

REPL

And… other things?

102: Process API Updates 110: HTTP 2 Client 143: Improve Contended Locking 158: Unified JVM Logging 165: Compiler Control 193: Variable Handles 197: Segmented Code Cache 199: Smart Java Compilation, Phase Two 200: The Modular JDK 201: Modular Source Code 211: Elide Deprecation Warnings on Import Statements 212: Resolve Lint and Doclint Warnings 213: Milling Project Coin 214: Remove GC Combinations Deprecated in JDK 8 215: Tiered Attribution for javac 216: Process Import Statements Correctly 217: Annotations Pipeline 2.0 219: Datagram Transport Layer Security (DTLS) 220: Modular Run-Time Images 221: Simplified Doclet API 222: jshell : The Java Shell (Read- Eval -Print Loop) 223: New Version-String Scheme 224: HTML5 Javadoc 225: Javadoc Search 226: UTF-8 Property Files 227: Unicode 7.0 228: Add More Diagnostic Commands 229: Create PKCS12 Keystores by Default 231: Remove Launch-Time JRE Version Selection 232: Improve Secure Application Performance 233: Generate Run-Time Compiler Tests Automatically 235: Test Class-File Attributes Generated by javac 236: Parser API for Nashorn 237: Linux/AArch64 Port 238: Multi-Release JAR Files 240: Remove the JVM TI hprof Agent 241: Remove the jhat Tool 243: Java-Level JVM Compiler Interface 244: TLS Application-Layer Protocol Negotiation Extension 245: Validate JVM Command-Line Flag Arguments 246: Leverage CPU Instructions for GHASH and RSA 247: Compile for Older Platform Versions 248: Make G1 the Default Garbage Collector 249: OCSP Stapling for TLS 250: Store Interned Strings in CDS Archives 251: Multi-Resolution Images 252: Use CLDR Locale Data by Default 253: Prepare JavaFX UI Controls & CSS APIs for Modularization 254: Compact Strings 255: Merge Selected Xerces 2.11.0 Updates into JAXP 256: BeanInfo Annotations 257: Update JavaFX/Media to Newer Version of GStreamer 258: HarfBuzz Font-Layout Engine 259: Stack-Walking API 260: Encapsulate Most Internal APIs 261: Module System 262: TIFF Image I/O 263: HiDPI Graphics on Windows and Linux 264: Platform Logging API and Service 265: Marlin Graphics Renderer 266: More Concurrency Updates 267: Unicode 8.0 268: XML Catalogs 269: Convenience Factory Methods for Collections 270: Reserved Stack Areas for Critical Sections 271: Unified GC Logging 272: Platform-Specific Desktop Features 273: DRBG-Based SecureRandom Implementations 274: Enhanced Method Handles 275: Modular Java Application Packaging 276: Dynamic Linking of Language-Defined Object Models 277: Enhanced Deprecation 278: Additional Tests for Humongous Objects in G1 279: Improve Test-Failure Troubleshooting 280: Indify String Concatenation 281: HotSpot C++ Unit-Test Framework 282: jlink : The Java Linker 283: Enable GTK 3 on Linux 284: New HotSpot Build System 285: Spin-Wait Hints 287: SHA-3 Hash Algorithms 288: Disable SHA-1 Certificates 289: Deprecate the Applet API 290: Filter Incoming Serialization Data 292: Implement Selected ECMAScript 6 Features in Nashorn 294: Linux/s390x Port 295: Ahead-of-Time Compilation 297: Unified arm32/arm64 Port 298: Remove Demos and Samples

Caveats & Disclaimers

Java 9 in Production?

Everything is EA

The Case Study

Twitter Dashboard

http://bit.ly/Java8InAnger

Compiling with Java 9

Jigsaw

module-info.java

Pain Some structural reorganisation may be needed This project has no command-line build IDE support is not what we’re used to RTFM. No, really do.

Cleaner design Smaller deployables Gain

Reactive API

Reactive Streams API

Akka Streams MongoDB Reactive Java Driver Ratpack Reactive Rabbit   Reactor   RxJava Vert.x   Implementations

Java 9 Flow API

Where to use it?

Reactive In Practice

Java 8 vs Reactive

Work with multiple streams Have multiple consumers Backpressure Very different concurrency model Reactive API lets you work with different implementations Reactive

Other Java 9 Features

269: Convenience Factory Methods for Collections

213: Private Methods on Interfaces

N ew Methods on the Streams API

259: Stack-Walking API

238: Multi-Release JAR Files

102: Process API Updates

277: Updated Deprecation

224: HTML5 Javadoc

225: Javadoc search

JShell (REPL)

https:// java.net/downloads/adoptopenjdk/REPL_Tutorial.pdf

We’d Love Your Help https:// youtrack.jetbrains.com/issue/IDEA-161611

The Pain

Your code might break! Try it out now to find out sooner, not later

214: Remove Deprecated GC Combinations 231: Remove Launch-Time JRE Version Selection 240: Remove the JVM TI hprof Agent 241: Remove the jhat Tool 260: Encapsulate Most Internal APIs 289: Deprecate the Applet API 298: Remove Demos and Samples Going Away

158: Unified JVM Logging 223 : New Version-String Scheme 245: Validate JVM Command-Line Flag Arguments 248: Make G1 the Default Garbage Collector 271: Unified GC Logging Possible Unexpected Behaviour

Java 9 is still evolving So are the tools we use

Don’t rush in to modularisation It might not be for you

Reactive Streams are not the same as Java 8 Streams Different behaviour, different use cases

The Gain

Encourages good design

Encourages new ways of working

Just a bit nicer to write code

http:// bit.ly/RealJava9