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.

Java Modularity: the Year After

448 views

Published on

In September 2017 the long-awaited release of Java 9 gave us a new module system in Java. It also kick-started the release-train of frequent Java releases, with Java 11 being the first long-term supported Java version poised to take modules into the mainstream. So what has happened since the introduction of the module system?

This talk will provide an overview adoption of modules in open-source libraries, IDEs, build tools, and so on. It will also feature tools that have emerged to make working with modules easier. Expect an honest overview of the current state of modules in Java, with lots of demos to show what's possible. After this talk you can start developing your own modular Java application without hesitation!

Published in: Software
  • 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 THIS BOOKS INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ...................................ALL FOR EBOOKS................................................. Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy,
       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 THIS BOOKS INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... Download Full EPUB Ebook here { http://bit.ly/2m6jJ5M } ......................................................................................................................... ...................................ALL FOR EBOOKS................................................. Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THAT BOOKS/FILE INTO AVAILABLE FORMAT - (Unlimited) ......................................................................................................................... ......................................................................................................................... Download FULL PDF EBOOK here { http://bit.ly/2m6jJ5M } ......................................................................................................................... .............. Browse by Genre Available 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 Christian, Classics, Comics, Contemporary, Cookbooks, Art, Biography, Business, Chick Lit, Children's, Manga, Memoir, Music, Science, Science Fiction, Self Help, History, Horror, Humor And Comedy, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • ..............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
  • 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
  • Be the first to like this

Java Modularity: the Year After

  1. 1. By Sander Mak Java Modularity: @Sander_Mak The Year After
  2. 2. About Sander Fellow, Software Architect @ Luminis Experience in modular development stacks Conference Speaker & Author
  3. 3. @Sander_Mak Quick Java Module Refresher
  4. 4. @Sander_Mak module main { } module-info.java Module Descriptors
  5. 5. @Sander_Mak module main { } module-info.java Module Descriptors main.web main.persistence main.integration main
  6. 6. @Sander_Mak module main { requires helper; } module-info.java module helper { } module-info.java Explicit Dependencies main.web main.persistence main.integration main
  7. 7. @Sander_Mak module main { requires helper; } module-info.java module helper { } module-info.java helper Explicit Dependencies main.web main.persistence main.integration main
  8. 8. @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
  9. 9. @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
  10. 10. @Sander_Mak Improvements Since Java 9
  11. 11. @Sander_Mak Improvements Since Java 9
  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 Why? Modular JDK Maintainability Reliable composition jlink main lib1 lib2 java.base java.logging java.xml Custom Run-time Image Flexibility
  16. 16. @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
  17. 17. @Sander_Mak Let's Talk About Adoption
  18. 18. @Sander_Mak Let's Talk About Adoption
  19. 19. @Sander_Mak Let's Talk About Adoption TEH CODEZ
  20. 20. @Sander_Mak https://jaxenter.com/java-8-still-strong-java-10-142642.html
  21. 21. @Sander_Mak https://jaxenter.com/java-8-still-strong-java-10-142642.html https://www.baeldung.com/java-in-2018
  22. 22. @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/
  23. 23. @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
  24. 24. @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
  25. 25. @Sander_Mak Java 11
  26. 26. @Sander_Mak Java 11 Java 9 Java 10 Java 12 Java 13 6 months Java 11
  27. 27. @Sander_Mak Java 11 Java 9 Java 10 Java 12 Java 13 6 months Java 11
  28. 28. @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
  29. 29. @Sander_Mak What About the Java Module System ?
  30. 30. @Sander_Mak What About the Java Module System ? JCP Survey: https://www.surveymonkey.com/results/SM-YR7YQJJJL/
  31. 31. @Sander_Mak Java 8 Lambdas & Streams
  32. 32. @Sander_Mak Java 8 Lambdas & Streams Java 9 Modularity
  33. 33. @Sander_Mak Let's Talk About Libraries
  34. 34. @Sander_Mak https://wiki.openjdk.java.net/display/quality/Quality+Outreach OpenJDK Quality Outreach
  35. 35. @Sander_Mak https://wiki.openjdk.java.net/display/quality/Quality+Outreach OpenJDK Quality Outreach Log4J, Jetty, Hibernate, Javassist, Mockito, RxJava, Spring, ...
  36. 36. @Sander_Mak https://wiki.openjdk.java.net/display/quality/Quality+Outreach OpenJDK Quality Outreach Log4J, Jetty, Hibernate, Javassist, Mockito, RxJava, Spring, ... 60% Java 10 compatible
  37. 37. @Sander_Mak Modular Libraries: Modularization Levels
  38. 38. @Sander_Mak Modular Libraries: Modularization Levels Level 0: ¯_(ツ)_/¯
  39. 39. @Sander_Mak Modular Libraries: Modularization Levels Level 0: ¯_(ツ)_/¯ Level 1: Automatic-Module-Name
  40. 40. @Sander_Mak Modular Libraries: Modularization Levels Level 0: ¯_(ツ)_/¯ Level 1: Automatic-Module-Name Level 2: Publish modularized JAR
  41. 41. @Sander_Mak Modular Libraries
  42. 42. @Sander_Mak Modular Libraries AdoptOpenJDK
 ModuleScanner +
  43. 43. @Sander_Mak Modular Libraries Level 2: Publish modularized JAR Preliminary results
  44. 44. @Sander_Mak Modular Libraries Level 2: Publish modularized JAR Preliminary results 1%
  45. 45. @Sander_Mak Modular Libraries Level 2: Publish modularized JAR Preliminary results 1% Level 1: Automatic-Module-Name 9%
  46. 46. @Sander_Mak Modular Libraries Level 2: Publish modularized JAR Preliminary results 1% Level 1: Automatic-Module-Name 9% Level 0: ¯_(ツ)_/¯ 90%
  47. 47. @Sander_Mak Modular Libraries Level 1: Spring, Hibernate, Jackson & other popular libs
  48. 48. @Sander_Mak Modular Libraries bit.ly/automaticmods Urge library maintainers to step up to at least Level 1 Level 1: Spring, Hibernate, Jackson & other popular libs
  49. 49. @Sander_Mak Modular Libraries AdoptOpenJDK
 + bit.ly/automaticmods Urge library maintainers to step up to at least Level 1 Level 1: Spring, Hibernate, Jackson & other popular libs
  50. 50. @Sander_Mak Let's Talk About Java EE
  51. 51. @Sander_Mak Let's Talk About Java EE Jakarta EE
  52. 52. @Sander_Mak bit.ly/jakartaee Jakarta EE
  53. 53. @Sander_Mak bit.ly/jakartaee Jakarta EE
  54. 54. @Sander_Mak bit.ly/jakartaee Embrace modules: Modularized artifacts Platform-wide structure Optional modules Jakarta EE
  55. 55. @Sander_Mak Modules: java.xml.bind java.xml.ws java.ws.rs java.mail java.json ... Automatic modules: java.persistence java.transaction java.activation ... Jakarta EE
  56. 56. @Sander_Mak Module-aware WARs? EARs?
  57. 57. @Sander_Mak Module-aware WARs? EARs? Enterprise Edition - Call for pricing1
  58. 58. @Sander_Mak Let's Talk About Tooling
  59. 59. @Sander_Mak Let's Talk About Tooling
  60. 60. @Sander_Mak
  61. 61. @Sander_Mak pom.xml module1/ pom.xml /src/main/java /module-info.java /com/m1/Mod1.java module2/ pom.xml /src/main/java /module-info.java /com/m2/Mod2.java
  62. 62. @Sander_Mak pom.xml module1/ pom.xml /src/main/java /module-info.java /com/m1/Mod1.java module2/ pom.xml /src/main/java /module-info.java /com/m2/Mod2.java
  63. 63. @Sander_Mak pom.xml module1/ pom.xml /src/main/java /module-info.java /com/m1/Mod1.java module2/ pom.xml /src/main/java /module-info.java /com/m2/Mod2.java <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>3.8.0</version> <configuration> <release>11</release> </configuration> </plugin>
  64. 64. @Sander_Mak Demo
  65. 65. @Sander_Mak
  66. 66. @Sander_Mak
  67. 67. @Sander_Mak
  68. 68. @Sander_Mak guides.gradle.org/building-java-9-modules/ While Gradle version 4.10-rc-2 doesn’t have first-class support for Java 9 modules yet, this guide shows you how to experiment with them before that support is complete.
  69. 69. @Sander_Mak guides.gradle.org/building-java-9-modules/ While Gradle version 4.10-rc-2 doesn’t have first-class support for Java 9 modules yet, this guide shows you how to experiment with them before that support is complete.
  70. 70. @Sander_Mak guides.gradle.org/building-java-9-modules/ While Gradle version 4.10-rc-2 doesn’t have first-class support for Java 9 modules yet, this guide shows you how to experiment with them before that support is complete.
  71. 71. @Sander_Mak guides.gradle.org/building-java-9-modules/ While Gradle version 4.10-rc-2 doesn’t have first-class support for Java 9 modules yet, this guide shows you how to experiment with them before that support is complete.
  72. 72. @Sander_Mak 22 June 2017 guides.gradle.org/building-java-9-modules/ While Gradle version 4.10-rc-2 doesn’t have first-class support for Java 9 modules yet, this guide shows you how to experiment with them before that support is complete.
  73. 73. @Sander_Mak 22 June 2017
  74. 74. @Sander_Mak Fear No More!
  75. 75. @Sander_Mak Fear No More!
  76. 76. @Sander_Mak Fear No More! github.com/java9-modularity/gradle-modules-plugin
  77. 77. @Sander_Mak Let's Talk About Tooling IDE
  78. 78. @Sander_Mak
  79. 79. @Sander_Mak
  80. 80. @Sander_Mak
  81. 81. @Sander_Mak Let's Talk About Tooling MISC
  82. 82. @Sander_Mak Black Box Testing
  83. 83. @Sander_Mak mylibrary.api mylibrary.impl mylibrary Black Box Testing
  84. 84. @Sander_Mak mylibrary.api mylibrary.impl mylibrary JUnit5 + junit-platform-maven-plugin Black Box Testing
  85. 85. @Sander_Mak mylibrary.api mylibrary.impl mylibrary JUnit5 + junit-platform-maven-plugin Black Box Testing mylibrary.itest.Test mylibrary.itest requires
  86. 86. @Sander_Mak mylibrary.api mylibrary.impl mylibrary JUnit5 + junit-platform-maven-plugin Black Box Testing mylibrary.itest.Test mylibrary.itest requires
  87. 87. @Sander_Mak mylibrary.api mylibrary.impl mylibrary JUnit5 + junit-platform-maven-plugin White Box Testing
  88. 88. @Sander_Mak mylibrary.api mylibrary.impl mylibrary JUnit5 + junit-platform-maven-plugin White Box Testing mylibrary.impl.Test mylibrary
  89. 89. @Sander_Mak mylibrary.api mylibrary.impl mylibrary JUnit5 + junit-platform-maven-plugin White Box Testing mylibrary.impl.Test mylibrary --patch-module
  90. 90. @Sander_Mak mylibrary.api mylibrary.impl mylibrary.impl.Test mylibrary JUnit5 + junit-platform-maven-plugin White Box Testing mylibrary.impl.Test mylibrary --patch-module
  91. 91. @Sander_Mak jlink
  92. 92. @Sander_Mak jlink + main lib1 lib2 jdk ~300mb application ~2mb
  93. 93. @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
  94. 94. @Sander_Mak jlink + main lib1 lib2 jdk ~300mb application ~2mb JVM main lib1 lib2 java.base java.logging java.xml Custom Run-time Image
  95. 95. @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
  96. 96. @Sander_Mak ModiTect Manage module-info in Maven
  97. 97. @Sander_Mak ModiTect <groupId>org.moditect</groupId> <artifactId>moditect-maven-plugin</artifactId> ... <module> <moduleInfo> <name>easytext.gui</name> <exports>javamodularity.easytext.api.*;</exports> <opens>javamodularity.easytext.gui to javafx.graphics;</opens> <addServiceUses>true</addServiceUses> </moduleInfo> <mainClass>javamodularity.easytext.gui.Main</mainClass> </module> Manage module-info in Maven
  98. 98. @Sander_Mak ModiTect <groupId>org.moditect</groupId> <artifactId>moditect-maven-plugin</artifactId> ... <module> <moduleInfo> <name>easytext.gui</name> <exports>javamodularity.easytext.api.*;</exports> <opens>javamodularity.easytext.gui to javafx.graphics;</opens> <addServiceUses>true</addServiceUses> </moduleInfo> <mainClass>javamodularity.easytext.gui.Main</mainClass> </module> Manage module-info in Maven
  99. 99. @Sander_Mak ModiTect <groupId>org.moditect</groupId> <artifactId>moditect-maven-plugin</artifactId> ... <module> <moduleInfo> <name>easytext.gui</name> <exports>javamodularity.easytext.api.*;</exports> <opens>javamodularity.easytext.gui to javafx.graphics;</opens> <addServiceUses>true</addServiceUses> </moduleInfo> <mainClass>javamodularity.easytext.gui.Main</mainClass> </module> Manage module-info in Maven
  100. 100. @Sander_Mak ModiTect <groupId>org.moditect</groupId> <artifactId>moditect-maven-plugin</artifactId> ... <module> <moduleInfo> <name>easytext.gui</name> <exports>javamodularity.easytext.api.*;</exports> <opens>javamodularity.easytext.gui to javafx.graphics;</opens> <addServiceUses>true</addServiceUses> </moduleInfo> <mainClass>javamodularity.easytext.gui.Main</mainClass> </module> Manage module-info in Maven
  101. 101. @Sander_Mak ModiTect Add module descriptors to existing JARs Use jlink with automatic modules too Create Docker + custom-runtime image You can keep your build on Java 8
  102. 102. @Sander_Mak It's Time to Wrap Up
  103. 103. @Sander_Mak
  104. 104. @Sander_Mak Java 9 Java 10
  105. 105. @Sander_Mak Java 9 Java 10
  106. 106. @Sander_Mak
  107. 107. @Sander_Mak "It is too early to say whether modules will achieve widespread use outside of the JDK itself. In the meantime, it seems best to avoid them unless you have a compelling need." -- Josh Bloch
  108. 108. @Sander_Mak "It is too early to say whether modules will achieve widespread use outside of the JDK itself. In the meantime, it seems best to see for yourself whether a modular approach fits your codebase." -- Sander Mak
  109. 109. Thanks. Read More: javamodularity.com @Sander_Mak bit.ly/ps-sander

×