Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Plug-in Architectures With Layrry and the Java Module System

Plug-in Architectures With Layrry and the Java Module System

The Java Module System lays the foundation for building modularized applications on the JVM. It doesn't concern itself though with resolving module versions and obtaining modules from remote repositories. This is where Layrry [1] comes in: an API and launcher for modularized Java applications which takes a descriptor of the module layer(s) to assemble, fetches the modules and starts up the application. Also dynamically added and removed plug-ins become a possibility with Layrry.

[1] https://www.morling.dev/blog/plugin-architectures-with-layrry-and-the-java-module-system/


Gunnar Morling

September 10, 2020


  1. Plug-in Architectures With Layrry and the Java Module System Gunnar

    Morling @gunnarmorling
  2. Some User Statements “JPMS only allows for one version of

    a module” “JPMS doesn’t allow to add modules at runtime” “I need to modularize ALL my dependencies in order to benefit from JPMS” “It’s so hard to map dependency coordinates to module dependences” “Help, non-exported packages of different modules collide!”
  3. What no one ever said “Let’s use JPMS Layers to

    tackle (some of) these issues”
  4. Module Layers https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/lang/ModuleLayer.html

  5. Using the Layers API

  6. Hello, Layrry! An API and Launcher for Modularized Java Applications

  7. Hello, Layrry!

  8. Layrry JPMS © Christoper Michel https://flic.kr/p/UMtHv5 (CC BY 2.0)

  9. Ready-Made Launcher

  10. Plug-in Architectures © Justin Taylor https://flic.kr/p/4fQz9t (CC BY 2.0)

  11. Plug-in Architectures Can dynamically add (and remove) layers at runtime

  12. © Bob Adams https://flic.kr/p/cYV7gq (CC BY-SA 2.0) Demo

  13. Demo

  14. Resources Source code https://github.com/moditect/layrry Blog posts https://www.morling.dev/blog/introducing-layrry-runner-and-api-for- modularized-java-applications/ https://www.morling.dev/blog/plugin-architectures-with-layrry-and- the-java-module-system/