Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Coding Your Way to Java 12

1,588 views

Published on

It seems like keeping up to date with Java nowadays is an enormous task. Gone is the era of big, delayed Java releases that span years. We're now getting a new major release every six months. What's up with that? You're probably still developing on Java 8, even though Java 12 is already available.
Join this session to get a code-first overview of what's new in Java since Java 8. We'll give an overview of the module system (Java 9), the local-variable type inference feature (Java 10), the new HttpClient API (Java 11) and a sneak peek of Switch Expressions in Java 12. Expect lots of advice on what to expect when migrating beyond Java 8. It's time to embrace the newfound agility of the Java platform!

Published in: Technology
  • ..............ACCESS that WEBSITE Over for All Ebooks ................ ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • accessibility Books Library allowing access to top content, including thousands of title from favorite author, plus the ability to read or download a huge selection of books for your pc or smartphone within minutes ,Download or read Ebooks here ... ......................................................................................................................... Download FULL PDF EBOOK here { http://bit.ly/2m6jJ5M }
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • (Unlimited)....ACCESS WEBSITE Over for All Ebooks ................ accessibility Books Library allowing access to top content, including thousands of title from favorite author, plus the ability to read or download a huge selection of books for your pc or smartphone within minutes ......................................................................................................................... DOWNLOAD FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M }
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • accessibility Books Library allowing access to top content, including thousands of title from favorite author, plus the ability to read or download a huge selection of books for your pc or smartphone within minutes.........ACCESS WEBSITE Over for All Ebooks ..... (Unlimited) ......................................................................................................................... Download FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Coding Your Way to Java 12

  1. 1. By Sander Mak Coding Your Way @Sander_Mak to Java 12
  2. 2. About Sander Fellow, Software Architect @ Luminis Experience in modular development stacks Conference Speaker & Author
  3. 3. @Sander_Mak Java 9 (Sept. 2017)
  4. 4. @Sander_Mak Quick Java Module Overview
  5. 5. @Sander_Mak module main { } module-info.java Module Declarations
  6. 6. @Sander_Mak module main { } module-info.java Module Declarations main.web main.persistence main.integration main
  7. 7. @Sander_Mak module main { requires helper; } module-info.java module helper { } module-info.java Explicit Dependencies main.web main.persistence main.integration main
  8. 8. @Sander_Mak module main { requires helper; } module-info.java module helper { } module-info.java helper Explicit Dependencies main.web main.persistence main.integration main
  9. 9. @Sander_Mak module main { requires helper; } module helper { exports helper.api; } module-info.java module-info.java helper.api helper Well-defined Interfaces main.web main.persistence main.integration main
  10. 10. @Sander_Mak module main { requires helper; } module helper { exports helper.api; } module-info.java module-info.java helper.api helper.impl helper Strong Encapsulation main.web main.persistence main.integration main
  11. 11. @Sander_Mak Demo: EasyText easytext.cli easytext.analysis
  12. 12. @Sander_Mak Why?
  13. 13. @Sander_Mak Why? Modular JDK
  14. 14. @Sander_Mak Why? Modular JDK Maintainability Reliable composition Flexibility
  15. 15. @Sander_Mak quick refresher why/advantages (JDK: modularized, your app: architecture from whiteboard to code, explicit dependencies in language, strong encapsulation, jlink Why? Decrease the model-code gap
  16. 16. @Sander_Mak jlink
  17. 17. @Sander_Mak jlink + main lib1 lib2 jdk ~300mb application ~2mb
  18. 18. @Sander_Mak jlink + main lib1 lib2 jdk ~300mb application ~2mb JVM main lib1 lib2 java.base java.logging java.xml Custom Run-time Image ~25mb
  19. 19. @Sander_Mak jlink + main lib1 lib2 jdk ~300mb application ~2mb JVM main lib1 lib2 java.base java.logging java.xml Custom Run-time Image
  20. 20. @Sander_Mak IoT Device jlink + main lib1 lib2 jdk ~300mb application ~2mb JVM main lib1 lib2 java.base java.logging java.xml Custom Run-time Image
  21. 21. @Sander_Mak Impact on Java 8 codebases
  22. 22. @Sander_Mak Impact on Java 8 codebases Use of encapsulated JDK types: Run-time warnings Compile-time errors
  23. 23. @Sander_Mak Impact on Java 8 codebases Use of encapsulated JDK types: Run-time warnings Compile-time errors Use of enterprise APIs in JDK: Won't resolve by default Gone in Java 11! java.corba java.xml.bind java.xml.ws.* java.activation java.transaction
  24. 24. @Sander_Mak R jshell E P L
  25. 25. @Sander_Mak R jshell E P L ead
  26. 26. @Sander_Mak R jshell E P L ead val
  27. 27. @Sander_Mak R jshell E P L ead val rint
  28. 28. @Sander_Mak R jshell E P L ead val rint oop
  29. 29. @Sander_Mak R jshell E P L ead val rint oop Input code
  30. 30. @Sander_Mak R jshell E P L ead val rint oop Input code Run code
  31. 31. @Sander_Mak R jshell E P L ead val rint oop Input code Run code See results
  32. 32. @Sander_Mak R jshell E P L ead val rint oop Input code Run code See results Iteratively refine
  33. 33. @Sander_Mak jshell DEMO
  34. 34. @Sander_Mak Collection Factory Methods
  35. 35. @Sander_Mak List<String> books = new ArrayList<>(); books.add("Java 9 Modularity"); books.add("Designing Data-Intensive Applications"); books.add("Java 8 Lambdas"); Collection Factory Methods
  36. 36. @Sander_Mak Collection Factory Methods List<String> books = List.of("Java 9 Modularity", "Designing Data-Intensive Applications", "Java 8 Lambdas");
  37. 37. @Sander_Mak Collection Factory Methods List<String> books = List.of("Java 9 Modularity", "Designing Data-Intensive Applications", "Java 8 Lambdas"); Set.of Map.of
  38. 38. @Sander_Mak Java 10 (March 2018)
  39. 39. @Sander_Mak var
  40. 40. @Sander_Mak var String name = "Sander";
  41. 41. @Sander_Mak var String name = "Sander"; public void aMethod() { String name = "Sander"; }
  42. 42. @Sander_Mak var String name = "Sander"; public void aMethod() { String name = "Sander"; } public void aMethod() { var name = "Sander"; }
  43. 43. @Sander_Mak var URL url = new URL("https://javamodularity.com"); URLConnection connection = url.openConnection(); BufferedInputStream inputStream = new BufferedInputStream(connection.getInputStream());
  44. 44. @Sander_Mak var URL url = new URL("https://javamodularity.com"); URLConnection connection = url.openConnection(); BufferedInputStream inputStream = new BufferedInputStream(connection.getInputStream()); var bookurl = new URL("https://javamodularity.com"); var connection = bookurl.openConnection(); var bookStream = new BufferedInputStream(connection.getInputStream());
  45. 45. @Sander_Mak var URL url = new URL("https://javamodularity.com"); URLConnection connection = url.openConnection(); BufferedInputStream inputStream = new BufferedInputStream(connection.getInputStream()); var bookurl = new URL("https://javamodularity.com"); var connection = bookurl.openConnection(); var bookStream = new BufferedInputStream(connection.getInputStream());
  46. 46. @Sander_Mak var URL url = new URL("https://javamodularity.com"); URLConnection connection = url.openConnection(); BufferedInputStream inputStream = new BufferedInputStream(connection.getInputStream()); var bookurl = new URL("https://javamodularity.com"); var connection = bookurl.openConnection(); var bookStream = new BufferedInputStream(connection.getInputStream()); DEMO
  47. 47. @Sander_Mak Java 11 (Sept. 2018)
  48. 48. @Sander_Mak HttpClient HttpURLConnection HTTP/2 & WebSocket Reactive Streams Support
  49. 49. @Sander_Mak HttpClient send sendAsync ... HttpClient
  50. 50. @Sander_Mak HttpClient send sendAsync ... HttpClient.Builder newBuilder HttpClient
  51. 51. @Sander_Mak HttpClient send sendAsync ... HttpClient.Builder HttpRequest uri headers method ...newBuilder HttpClient
  52. 52. @Sander_Mak HttpClient send sendAsync ... HttpClient.Builder HttpRequest uri headers method ... HttpRequest.Builder newBuilder newBuilder HttpClient
  53. 53. @Sander_Mak HttpClient send sendAsync ... HttpClient.Builder HttpRequest uri headers method ... HttpRequest.Builder HttpResponse uri statusCode body ...newBuilder newBuilder HttpClient
  54. 54. @Sander_Mak HttpClient HttpClient httpClient = HttpClient.newHttpClient(); HttpRequest req = HttpRequest.newBuilder(URI.create("https://google.com")) .GET() .build(); HttpResponse<String> response = httpClient.send(req, BodyHandlers.ofString())
  55. 55. @Sander_Mak Java 12 (March 2019)
  56. 56. @Sander_Mak Preview Feature: Switch Expression
  57. 57. @Sander_Mak Preview Feature: Switch Expression int numLetters = switch (day) { case MONDAY, FRIDAY, SUNDAY -> 6; case TUESDAY -> 7; case THURSDAY, SATURDAY -> 8; case WEDNESDAY -> 9; };
  58. 58. @Sander_Mak Let's Talk About Adoption
  59. 59. @Sander_Mak https://jaxenter.com/java-8-still-strong-java-10-142642.html
  60. 60. @Sander_Mak https://jaxenter.com/java-8-still-strong-java-10-142642.html https://www.baeldung.com/java-in-2018
  61. 61. @Sander_Mak https://jaxenter.com/java-8-still-strong-java-10-142642.html https://www.baeldung.com/java-in-2018 https://www.jetbrains.com/research/devecosystem-2018/java/
  62. 62. @Sander_Mak https://jaxenter.com/java-8-still-strong-java-10-142642.html https://www.baeldung.com/java-in-2018 https://www.jetbrains.com/research/devecosystem-2018/java/ Java Magazine & Snyk
  63. 63. @Sander_Mak https://jaxenter.com/java-8-still-strong-java-10-142642.html https://www.baeldung.com/java-in-2018 https://www.jetbrains.com/research/devecosystem-2018/java/ Java Magazine & Snyk
  64. 64. @Sander_Mak Java 11
  65. 65. @Sander_Mak Java 11 Java 9 Java 10 Java 12 Java 13 6 months Java 11
  66. 66. @Sander_Mak Java 11 Java 9 Java 10 Java 12 Java 13 6 months Java 11
  67. 67. @Sander_Mak Java 11 Long Term Support Java 9 Java 10 Java 12 Java 13 6 months Java 11 Java 11 LTS minimum 3 years
  68. 68. @Sander_Mak Which JDK? JDK 11 changes the game
  69. 69. Thanks. Read More: javamodularity.com @Sander_Mak bit.ly/ps-sander

×