SlideShare una empresa de Scribd logo
1 de 50
Descargar para leer sin conexión
@aalmiray | andresalmiray.com
Building modular applications
with the Java Platform
Module System and Layrry
Happy 20th
Anniversary!
Andres
Almiray
Seasoned Sourceror

@ Oracle

Apache Groovy PMC

Java Champion

Hackergarten

github.com/aalmiray
@aalmiray | andresalmiray.com
JPMS
@aalmiray | andresalmiray.com
JPMS
@aalmiray | andresalmiray.com
Java Platform
Module System
@aalmiray | andresalmiray.com
Java Platform
Module System
• Also known by its project nickname: Jigsaw

• Introduced in Java 9

• Designed to break down the JVM monolith

• Applicable to user space as well

• The promise is to give developers better code
encapsulation and design foundations
However …
@aalmiray | andresalmiray.com
Some user statements
• It only allows for one version of a module

• It doesn’t allow adding modules at runtime

• I have to modularize ALL dependencies to reap the
benefits of the Java Platform Module System

• It’s so hard to map dependency coordinates to module
dependencies

• Help, non-exported packages of different modules collide!
@aalmiray | andresalmiray.com
What no one ever said
“Let’s use Module Layers to
tackle (some of) these issues”
https://docs.oracle.com/en/java/javase/15/docs/api/java.base/java/lang/ModuleLayer.html
@aalmiray | andresalmiray.com
Using the Layers API
!! Conflict !!
@aalmiray | andresalmiray.com
https://github.com/
moditect/layrry/
Gunnar
Morling
Open Source Software
Engineer

@ RedHat

Java Champion

Lead of Debezium

Bean Validation 2.0 Spec Lead

morling.dev
@aalmiray | andresalmiray.com
Hello Layrry!
Layrry
Java Platform
Module System
External Configuration
YAML sucks!
TOML rocks!
Parameterization
Launch!
$ java -jar layrry-launcher-1.0.0.Alpha1-all.jar 
—layers-config javafx.toml 
—properties versions.properties
$ sdk install layrry 1.0.0.Alpha1
$ layrry —layers-config javafx.toml 
—properties versions.properties
$ sdk install jbang
$ jbang layrry@moditect 
—layers-config javafx.toml 
—properties versions.properties
Local Repositories
Local Repositories
• Artifacts can be organized in a local repository that does not require remote resolution

• Two layouts currently supported

Repository Layouts
Remote Layers
@aalmiray | andresalmiray.com
Remote Layers
• Layer configuration (and properties) files hosted at
remote locations.

• Mixing remote and local repositories is allowed.

• Supports dynamic plugins, plugin directories can only
be local.
Plugin Architectures
1 package org.moditect.layrry.platform;
2
3 /**
4 * Implementations get notified about the
5 * addition or removal of plug-in layers.
6 * Retrieved via the service loader API.
7 */
8 public interface PluginLifecycleListener {
9
10 void pluginAdded(PluginDescriptor plugin);
11
12 void pluginRemoved(PluginDescriptor plugin);
13 }
1 @Override
2 public void pluginAdded(PluginDescriptor plugin) {
3 ServiceLoader<MyService> services = ServiceLoader.load(
4 plugin.getModuleLayer(), MyService.class);
5
6 services.forEach(service -> {
7 // only process services declared by the added layer itself,
8 // but not from ancestor layers
9 if (service.getClass().getModule().getLayer() == layer) {
10 // process service ...
11 }
12 });
13 }
DEMO
Memory Leaks
Future
@aalmiray | andresalmiray.com
Future
• Binary distributions: Homebrew, Snap, Chocolatey, etc.

• Ability to create self-contained distributions
(e.g. jlink, Capsule)

• Derive layers from pom.xml?

• Programmatic plug-in API

• More JFR events for diagnostics

• Your contributions?!
@aalmiray | andresalmiray.com
Resources
• https://github.com/moditect/layrry/

• https://github.com/moditect/layrry-examples/
@aalmiray | andresalmiray.com
Resources
• 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/

• https://www.morling.dev/blog/class-unloading-in-layered-
java-applications/

• http://andresalmiray.com/layrry-1-0-0-alpha1-has-been-
released/
@aalmiray | andresalmiray.com

Más contenido relacionado

La actualidad más candente

watir-webdriver
watir-webdriverwatir-webdriver
watir-webdriver
Amit DEWAN
 

La actualidad más candente (20)

Laravel Introduction
Laravel IntroductionLaravel Introduction
Laravel Introduction
 
Coding Your Way to Java 12
Coding Your Way to Java 12Coding Your Way to Java 12
Coding Your Way to Java 12
 
Laravel introduction
Laravel introductionLaravel introduction
Laravel introduction
 
Intro to Laravel
Intro to LaravelIntro to Laravel
Intro to Laravel
 
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
An Introduction to the Laravel Framework (AFUP Forum PHP 2014)
 
All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$All the Laravel things: up and running to making $$
All the Laravel things: up and running to making $$
 
Agile sites @ telmore
Agile sites @ telmore Agile sites @ telmore
Agile sites @ telmore
 
Play! Framework for JavaEE Developers
Play! Framework for JavaEE DevelopersPlay! Framework for JavaEE Developers
Play! Framework for JavaEE Developers
 
watir-webdriver
watir-webdriverwatir-webdriver
watir-webdriver
 
Agile sites311training
Agile sites311trainingAgile sites311training
Agile sites311training
 
Agile sites2
Agile sites2Agile sites2
Agile sites2
 
Projects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 ProjectsProjects In Laravel : Learn Laravel Building 10 Projects
Projects In Laravel : Learn Laravel Building 10 Projects
 
Laravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web ArtisansLaravel - The PHP Framework for Web Artisans
Laravel - The PHP Framework for Web Artisans
 
Laravel
LaravelLaravel
Laravel
 
Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)Web application development using Play Framework (with Java)
Web application development using Play Framework (with Java)
 
Introduction to Play Framework
Introduction to Play FrameworkIntroduction to Play Framework
Introduction to Play Framework
 
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...Laravel development (Laravel History, Environment Setup & Laravel Installatio...
Laravel development (Laravel History, Environment Setup & Laravel Installatio...
 
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...
Test Automation using Ruby, Watir, Rspec and AutoIT for GAMESCALE products te...
 
Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014Xitrum @ Scala Matsuri Tokyo 2014
Xitrum @ Scala Matsuri Tokyo 2014
 
Knowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP frameworkKnowing Laravel 5 : The most popular PHP framework
Knowing Laravel 5 : The most popular PHP framework
 

Similar a Building modular applications with the Java Platform Module System and Layrry

01/2009 - Portral development with liferay
01/2009 - Portral development with liferay01/2009 - Portral development with liferay
01/2009 - Portral development with liferay
daveayan
 
Benefits of an Open environment with Wakanda
Benefits of an Open environment with WakandaBenefits of an Open environment with Wakanda
Benefits of an Open environment with Wakanda
Alexandre Morgaut
 

Similar a Building modular applications with the Java Platform Module System and Layrry (20)

Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
 
Protractor survival guide
Protractor survival guideProtractor survival guide
Protractor survival guide
 
Oracle ADF Architecture TV - Development - Version Control
Oracle ADF Architecture TV - Development - Version ControlOracle ADF Architecture TV - Development - Version Control
Oracle ADF Architecture TV - Development - Version Control
 
Introduction to Apache Roller
Introduction to Apache RollerIntroduction to Apache Roller
Introduction to Apache Roller
 
Swagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlierSwagger - Making REST APIs friendlier
Swagger - Making REST APIs friendlier
 
01/2009 - Portral development with liferay
01/2009 - Portral development with liferay01/2009 - Portral development with liferay
01/2009 - Portral development with liferay
 
Introducing Apricot, The Eclipse Content Management Platform
Introducing Apricot, The Eclipse Content Management PlatformIntroducing Apricot, The Eclipse Content Management Platform
Introducing Apricot, The Eclipse Content Management Platform
 
Staying Sane with Drupal (A Develper's Survival Guide)
Staying Sane with Drupal (A Develper's Survival Guide)Staying Sane with Drupal (A Develper's Survival Guide)
Staying Sane with Drupal (A Develper's Survival Guide)
 
Eclipse Apricot
Eclipse ApricotEclipse Apricot
Eclipse Apricot
 
Liberty Deep Dive
Liberty Deep DiveLiberty Deep Dive
Liberty Deep Dive
 
JDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDKJDK 8 and JDK 8 Updates in OpenJDK
JDK 8 and JDK 8 Updates in OpenJDK
 
Gradle Again
Gradle AgainGradle Again
Gradle Again
 
GraalVM and Oracle's Documentation Trends.pdf
GraalVM and Oracle's Documentation Trends.pdfGraalVM and Oracle's Documentation Trends.pdf
GraalVM and Oracle's Documentation Trends.pdf
 
Java 9, JShell, and Modularity
Java 9, JShell, and ModularityJava 9, JShell, and Modularity
Java 9, JShell, and Modularity
 
Benefits of an Open environment with Wakanda
Benefits of an Open environment with WakandaBenefits of an Open environment with Wakanda
Benefits of an Open environment with Wakanda
 
Java modules
Java modulesJava modules
Java modules
 
Cloud Platforms for Java
Cloud Platforms for JavaCloud Platforms for Java
Cloud Platforms for Java
 
Java 9 Module System Introduction
Java 9 Module System IntroductionJava 9 Module System Introduction
Java 9 Module System Introduction
 
Oracle Fusion Middleware on Exalogic Best Practises
Oracle Fusion Middleware on Exalogic Best PractisesOracle Fusion Middleware on Exalogic Best Practises
Oracle Fusion Middleware on Exalogic Best Practises
 
MySQL docker with demo by Ramana Yeruva
MySQL docker with demo by Ramana YeruvaMySQL docker with demo by Ramana Yeruva
MySQL docker with demo by Ramana Yeruva
 

Más de Andres Almiray

Más de Andres Almiray (20)

Creando, creciendo, y manteniendo una comunidad de codigo abierto
Creando, creciendo, y manteniendo una comunidad de codigo abiertoCreando, creciendo, y manteniendo una comunidad de codigo abierto
Creando, creciendo, y manteniendo una comunidad de codigo abierto
 
Liberando a produccion con confianza
Liberando a produccion con confianzaLiberando a produccion con confianza
Liberando a produccion con confianza
 
Liberando a produccion con confidencia
Liberando a produccion con confidenciaLiberando a produccion con confidencia
Liberando a produccion con confidencia
 
OracleDB Ecosystem for Java Developers
OracleDB Ecosystem for Java DevelopersOracleDB Ecosystem for Java Developers
OracleDB Ecosystem for Java Developers
 
Softcon.ph - Maven Puzzlers
Softcon.ph - Maven PuzzlersSoftcon.ph - Maven Puzzlers
Softcon.ph - Maven Puzzlers
 
Maven Puzzlers
Maven PuzzlersMaven Puzzlers
Maven Puzzlers
 
Oracle Database Ecosystem for Java Developers
Oracle Database Ecosystem for Java DevelopersOracle Database Ecosystem for Java Developers
Oracle Database Ecosystem for Java Developers
 
JReleaser - Releasing at the speed of light
JReleaser - Releasing at the speed of lightJReleaser - Releasing at the speed of light
JReleaser - Releasing at the speed of light
 
Going Reactive with g rpc
Going Reactive with g rpcGoing Reactive with g rpc
Going Reactive with g rpc
 
What I wish I knew about Maven years ago
What I wish I knew about Maven years agoWhat I wish I knew about Maven years ago
What I wish I knew about Maven years ago
 
The impact of sci fi in tech
The impact of sci fi in techThe impact of sci fi in tech
The impact of sci fi in tech
 
Gradle Ex Machina - Devoxx 2019
Gradle Ex Machina - Devoxx 2019Gradle Ex Machina - Devoxx 2019
Gradle Ex Machina - Devoxx 2019
 
Interacting with the Oracle Cloud Java SDK with Gradle
Interacting with the Oracle Cloud Java SDK with GradleInteracting with the Oracle Cloud Java SDK with Gradle
Interacting with the Oracle Cloud Java SDK with Gradle
 
Gradle ex-machina
Gradle ex-machinaGradle ex-machina
Gradle ex-machina
 
Go Java, Go!
Go Java, Go!Go Java, Go!
Go Java, Go!
 
Going Reactive with gRPC
Going Reactive with gRPCGoing Reactive with gRPC
Going Reactive with gRPC
 
The JavaFX Ecosystem
The JavaFX EcosystemThe JavaFX Ecosystem
The JavaFX Ecosystem
 
Understanding Reactive Programming
Understanding Reactive ProgrammingUnderstanding Reactive Programming
Understanding Reactive Programming
 
Spock's New Tricks
Spock's New TricksSpock's New Tricks
Spock's New Tricks
 
Go Java, Go!
Go Java, Go!Go Java, Go!
Go Java, Go!
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 

Último (20)

Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 

Building modular applications with the Java Platform Module System and Layrry