Slide 1

Slide 1 text

Plug-in Architectures With Layrry and the Java Module System Gunnar Morling @gunnarmorling

Slide 2

Slide 2 text

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!”

Slide 3

Slide 3 text

What no one ever said “Let’s use JPMS Layers to tackle (some of) these issues”

Slide 4

Slide 4 text

Module Layers https://docs.oracle.com/en/java/javase/14/docs/api/java.base/java/lang/ModuleLayer.html

Slide 5

Slide 5 text

Using the Layers API

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

Hello, Layrry!

Slide 8

Slide 8 text

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

Slide 9

Slide 9 text

Ready-Made Launcher

Slide 10

Slide 10 text

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

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

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

Slide 13

Slide 13 text

Demo

Slide 14

Slide 14 text

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/