SlideShare une entreprise Scribd logo
1  sur  24
Java Modularity
1 What is NOT modularity ?
2 So, what is modularity then ?
3 Why use modularity ?
4 Implementations of modularity
5 OSGi
6 Jigsaw
7 Jigsaw vs Osgi
8 References
What is NOT modularity ?
compile time runtime
What is NOT modularity ?
Monolithic system
• One piece
• No subcomponents
• Tight coupling
• No independent existence
• Growing functionality and
interdependence
so, what is modularity then ?
What is Modularity ?
• Module :
• Every single deployable unit
• Design technique that emphasises separating the functionality into
modules that are :
• Independent
• Interchangeable
• One functionality
Why use modularity?
Java Modularity - Why ?
• Pros
• Louse coupling
• Optimise development
• Escalation and evolution
• Reuse
• Ease testing
Java Modularity - Why ?
• Cons
• Adds tracking complexity
• Needs more good code practices
• Forces us to consider more flexibility
• Think about collateral effects
• May add architecture complexity
Java Modularity - Implementations
Java Modularity - Implementations
 SOA, micro-services
 OSGi
 Dynamic modularity
 Module lifecycle
 Service discovery
 Package security
 Package versioning
 Jigsaw
 Static modularity
 Mainly to create JRE subset
 Initially for small devices
Java Modularity - OSGi
Java Modularity - OSGi
 Started in 1998
 Different implementations : Equinox, Felix, Knoplerfish,
Karaf, Fabric8, Netbinox
 Current specs OSGi Alliance release 6.0
 Every bundle ( module )
 Its own class loader
 Its own lifecycle
 Service discovery
 Dynamic loading (lazy, eager activation)
 Meta information included in META-INF file
 Used in : Eclipse IDE, Netbeans IDE, Glassfish, WildFly, Adobe AEM (
Sling )
Java Modularity - Jigsaw
Java Modularity - Jigsaw
 Started in 2014
 In Early Access now, or final release in JDK 9 in 2017
 Explicit declaration of
 Importing modules
 Exporting packages
 Meta info in module-info.java file
 Module names must be unique
 Not includes versioning
 Introduce a new artifact format : JMOD
Java Modularity - Jigsaw
Modules dependencies in Jigsaw
com.foo.app
com.foo.app.api
com.foo.app.report
java.sql
java.logging
java.base
can not read
depends
java.xml
reads
com.foo.other
depends
reads
depends &
publishes
Java Modularity - Jigsaw
Module specification :
module com.foo.bar { // module definition
requires com.foo.baz; // module needed
exports com.foo.bar.alpha; // package published
exports com.foo.bar.beta to // package published ONLY
com.foo.client, // to these modules
com.foo.reporter;
provides com.foo.api.MyInterface with // publishing a service
com.foo.impl.MyImpl;
uses com.foo.api.YourInterface; // consuming a service
requires public com.slf4j; // module needed AND
// made readable to everyone
// who requires this module com.foo.bar
}
Java Modularity - Jigsaw / OSGi
Java Modularity - Jigsaw
Main differences
Jigsaw OSGi
Module dependency Java package dependency
Version agnostic ( only 1 allowed ) Version capable ( lots of versions
loaded at the same time )
No lifecycle management Lifecycle management
Export constraints No export constraints
Static modularity at deployment Dynamic modularity at deploy +
runtime
Java Modularity - References
Java Modularity - bloggers
Peter Kriens
@pkriens
Neil Bartlett
@nbartlett
Paul Bakker
@pbakker
JB Onofre
@jbonofre
Mark Reinhold
@mreinhold
Java Modularity - References
About Modularity ( monoliths / modular )
http://www.codingthearchitecture.com/2014/11/19/what_is_a_monolith.html
http://c2.com/cgi/wiki?MonolithicDesign
https://en.wikipedia.org/wiki/Modular_programming
About OSGi
https://www.osgi.org/developer/specifications/ ( specs )
http://njbartlett.name/files/osgibook_preview_20091217.pdf ( free old book )
About Jigsaw
http://openjdk.java.net/projects/jigsaw/ ( specs )
http://njbartlett.name/2015/11/13/osgi-jigsaw.html
https://www.youtube.com/watch?v=y8bpKYDrF5I
https://www.youtube.com/watch?v=UKC0uC7QUkI ( Mark’s Devoxx Talk )
Java Modularity - Books
Non modularity books
Martin FowlerGoF
Paul Bakker
Richard S. Hall
Achim Nierbeck
Thank you…. and happy coding !!!

Contenu connexe

Tendances

Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in PractiseDavid Bosschaert
 
Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Azilen Technologies Pvt. Ltd.
 
Open Services Gateway Initiative (OSGI)
Open Services Gateway Initiative (OSGI)Open Services Gateway Initiative (OSGI)
Open Services Gateway Initiative (OSGI)Peter R. Egli
 
Modules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module SystemModules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module SystemTim Ellison
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring FrameworkHùng Nguyễn Huy
 
Java & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkJava & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkMohit Belwal
 
Java SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introductionJava SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introductionStephen Colebourne
 
Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9Simon Ritter
 
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDIMigrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDIMario-Leander Reimer
 
MicroProfile for MicroServices
MicroProfile for MicroServicesMicroProfile for MicroServices
MicroProfile for MicroServicesMert Çalışkan
 
OSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaOSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaArun Gupta
 
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Martin Toshev
 
Software Design Principles (SOLID)
Software Design Principles (SOLID)Software Design Principles (SOLID)
Software Design Principles (SOLID)ASIMYILDIZ
 

Tendances (20)

Benefits of OSGi in Practise
Benefits of OSGi in PractiseBenefits of OSGi in Practise
Benefits of OSGi in Practise
 
Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7Step by step guide to create theme for liferay dxp 7
Step by step guide to create theme for liferay dxp 7
 
Modular JavaScript
Modular JavaScriptModular JavaScript
Modular JavaScript
 
Liferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for DevelopersLiferay (DXP) 7 Tech Meetup for Developers
Liferay (DXP) 7 Tech Meetup for Developers
 
Open Services Gateway Initiative (OSGI)
Open Services Gateway Initiative (OSGI)Open Services Gateway Initiative (OSGI)
Open Services Gateway Initiative (OSGI)
 
Migrating to Java 9 Modules
Migrating to Java 9 ModulesMigrating to Java 9 Modules
Migrating to Java 9 Modules
 
JDK-9: Modules and Java Linker
JDK-9: Modules and Java LinkerJDK-9: Modules and Java Linker
JDK-9: Modules and Java Linker
 
Modules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module SystemModules all the way down: OSGi and the Java Platform Module System
Modules all the way down: OSGi and the Java Platform Module System
 
Introduction to Spring Framework
Introduction to Spring FrameworkIntroduction to Spring Framework
Introduction to Spring Framework
 
Java & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate FrameworkJava & J2EE Struts with Hibernate Framework
Java & J2EE Struts with Hibernate Framework
 
Modules or microservices?
Modules or microservices?Modules or microservices?
Modules or microservices?
 
Java SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introductionJava SE 9 modules (JPMS) - an introduction
Java SE 9 modules (JPMS) - an introduction
 
Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9Modularization With Project Jigsaw in JDK 9
Modularization With Project Jigsaw in JDK 9
 
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDIMigrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
Migrating a JSF-Based Web Application from Spring 3 to Java EE 7 and CDI
 
Java Concurrent
Java ConcurrentJava Concurrent
Java Concurrent
 
MicroProfile for MicroServices
MicroProfile for MicroServicesMicroProfile for MicroServices
MicroProfile for MicroServices
 
OSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 IndiaOSGi and Java EE in GlassFish - Tech Days 2010 India
OSGi and Java EE in GlassFish - Tech Days 2010 India
 
Beyond OSGi Software Architecture
Beyond OSGi Software ArchitectureBeyond OSGi Software Architecture
Beyond OSGi Software Architecture
 
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)Modularity of The Java Platform Javaday (http://javaday.org.ua/)
Modularity of The Java Platform Javaday (http://javaday.org.ua/)
 
Software Design Principles (SOLID)
Software Design Principles (SOLID)Software Design Principles (SOLID)
Software Design Principles (SOLID)
 

En vedette

Manuscritos Econômico-Filosóficos e outros textos escolhidos - Karl Marx
Manuscritos Econômico-Filosóficos e outros textos escolhidos - Karl MarxManuscritos Econômico-Filosóficos e outros textos escolhidos - Karl Marx
Manuscritos Econômico-Filosóficos e outros textos escolhidos - Karl MarxIndianara Dos Santos Meurer
 
Hjelp vi flyr - alt om droner i TV-produksjon
Hjelp vi flyr - alt om droner i TV-produksjonHjelp vi flyr - alt om droner i TV-produksjon
Hjelp vi flyr - alt om droner i TV-produksjonnrkbeta
 
El Nuevo Marketing 2.0: ganar en la Nueva Normalidad
El Nuevo Marketing 2.0: ganar en la Nueva NormalidadEl Nuevo Marketing 2.0: ganar en la Nueva Normalidad
El Nuevo Marketing 2.0: ganar en la Nueva NormalidadNicola Origgi
 
moragoprl !!! 2008 Sevilla - Visita turistica !!!
moragoprl !!! 2008 Sevilla - Visita turistica !!!moragoprl !!! 2008 Sevilla - Visita turistica !!!
moragoprl !!! 2008 Sevilla - Visita turistica !!!Pedro Rodriguez
 
More than 1600 backlinks to Frontware.com
More than 1600 backlinks to Frontware.comMore than 1600 backlinks to Frontware.com
More than 1600 backlinks to Frontware.comFrontware International
 
Guía de trabajos prácticos
Guía de trabajos prácticosGuía de trabajos prácticos
Guía de trabajos prácticossoli10
 
Disrupt and Become Indispensable
Disrupt and Become IndispensableDisrupt and Become Indispensable
Disrupt and Become IndispensableMotivate Design
 
Content Startegy for a B2B Energy Client
Content Startegy for a B2B Energy Client Content Startegy for a B2B Energy Client
Content Startegy for a B2B Energy Client kmartchouk
 
Actividades de ecoturismo slideshare parte 1
Actividades de ecoturismo slideshare parte 1Actividades de ecoturismo slideshare parte 1
Actividades de ecoturismo slideshare parte 1nayelysantiago
 
Hoja de respuestas vertical de 60
Hoja de respuestas vertical de 60Hoja de respuestas vertical de 60
Hoja de respuestas vertical de 60Magu Sociales
 
Mesa Redonda: FINTECH. Revolución digital en el mundo Financiero. La oportuni...
Mesa Redonda: FINTECH. Revolución digital en el mundo Financiero. La oportuni...Mesa Redonda: FINTECH. Revolución digital en el mundo Financiero. La oportuni...
Mesa Redonda: FINTECH. Revolución digital en el mundo Financiero. La oportuni...AMETIC
 
Dictamen Asociación FF.MM Reclama por Escalafón de Mérito
Dictamen Asociación FF.MM Reclama por Escalafón de MéritoDictamen Asociación FF.MM Reclama por Escalafón de Mérito
Dictamen Asociación FF.MM Reclama por Escalafón de MéritoNelson Leiva®
 

En vedette (20)

Manuscritos Econômico-Filosóficos e outros textos escolhidos - Karl Marx
Manuscritos Econômico-Filosóficos e outros textos escolhidos - Karl MarxManuscritos Econômico-Filosóficos e outros textos escolhidos - Karl Marx
Manuscritos Econômico-Filosóficos e outros textos escolhidos - Karl Marx
 
Hjelp vi flyr - alt om droner i TV-produksjon
Hjelp vi flyr - alt om droner i TV-produksjonHjelp vi flyr - alt om droner i TV-produksjon
Hjelp vi flyr - alt om droner i TV-produksjon
 
55 PLUS Program pp
55 PLUS Program pp55 PLUS Program pp
55 PLUS Program pp
 
Oracle compra Sun
Oracle compra SunOracle compra Sun
Oracle compra Sun
 
Claudia sanchez
Claudia sanchezClaudia sanchez
Claudia sanchez
 
El Nuevo Marketing 2.0: ganar en la Nueva Normalidad
El Nuevo Marketing 2.0: ganar en la Nueva NormalidadEl Nuevo Marketing 2.0: ganar en la Nueva Normalidad
El Nuevo Marketing 2.0: ganar en la Nueva Normalidad
 
moragoprl !!! 2008 Sevilla - Visita turistica !!!
moragoprl !!! 2008 Sevilla - Visita turistica !!!moragoprl !!! 2008 Sevilla - Visita turistica !!!
moragoprl !!! 2008 Sevilla - Visita turistica !!!
 
PROGRAMA DE FESTIVIDADES 2014 - LIMÓN INDANZA
PROGRAMA DE FESTIVIDADES 2014 - LIMÓN INDANZAPROGRAMA DE FESTIVIDADES 2014 - LIMÓN INDANZA
PROGRAMA DE FESTIVIDADES 2014 - LIMÓN INDANZA
 
More than 1600 backlinks to Frontware.com
More than 1600 backlinks to Frontware.comMore than 1600 backlinks to Frontware.com
More than 1600 backlinks to Frontware.com
 
Guía de trabajos prácticos
Guía de trabajos prácticosGuía de trabajos prácticos
Guía de trabajos prácticos
 
Disrupt and Become Indispensable
Disrupt and Become IndispensableDisrupt and Become Indispensable
Disrupt and Become Indispensable
 
Content Startegy for a B2B Energy Client
Content Startegy for a B2B Energy Client Content Startegy for a B2B Energy Client
Content Startegy for a B2B Energy Client
 
Modul 2 kb 2
Modul 2 kb 2Modul 2 kb 2
Modul 2 kb 2
 
Actividades de ecoturismo slideshare parte 1
Actividades de ecoturismo slideshare parte 1Actividades de ecoturismo slideshare parte 1
Actividades de ecoturismo slideshare parte 1
 
Tu Eres Tu Marca, Construyela
Tu Eres Tu Marca, ConstruyelaTu Eres Tu Marca, Construyela
Tu Eres Tu Marca, Construyela
 
Hoja de respuestas vertical de 60
Hoja de respuestas vertical de 60Hoja de respuestas vertical de 60
Hoja de respuestas vertical de 60
 
Astana JUG. Introduction
Astana JUG. IntroductionAstana JUG. Introduction
Astana JUG. Introduction
 
Mesa Redonda: FINTECH. Revolución digital en el mundo Financiero. La oportuni...
Mesa Redonda: FINTECH. Revolución digital en el mundo Financiero. La oportuni...Mesa Redonda: FINTECH. Revolución digital en el mundo Financiero. La oportuni...
Mesa Redonda: FINTECH. Revolución digital en el mundo Financiero. La oportuni...
 
Imágenes y Palabras
Imágenes y PalabrasImágenes y Palabras
Imágenes y Palabras
 
Dictamen Asociación FF.MM Reclama por Escalafón de Mérito
Dictamen Asociación FF.MM Reclama por Escalafón de MéritoDictamen Asociación FF.MM Reclama por Escalafón de Mérito
Dictamen Asociación FF.MM Reclama por Escalafón de Mérito
 

Similaire à Java modularization

Java modulesystem
Java modulesystemJava modulesystem
Java modulesystemMarc Kassis
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Martin Toshev
 
Java 9 / Jigsaw - AJUG/VJUG session
Java 9 / Jigsaw - AJUG/VJUG  sessionJava 9 / Jigsaw - AJUG/VJUG  session
Java 9 / Jigsaw - AJUG/VJUG sessionMani Sarkar
 
Java 9: Deep Dive into Modularity and Dealing with Migration Issues
Java 9: Deep Dive into Modularity and Dealing with Migration IssuesJava 9: Deep Dive into Modularity and Dealing with Migration Issues
Java 9: Deep Dive into Modularity and Dealing with Migration IssuesGlobalLogic Ukraine
 
Enabling modularization through OSGi and SpringDM
Enabling modularization through OSGi and SpringDMEnabling modularization through OSGi and SpringDM
Enabling modularization through OSGi and SpringDMmukulobject
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Mihail Stoynov
 
Java 9 / Jigsaw - LJC / VJUG session (hackday session)
Java 9 / Jigsaw - LJC / VJUG session (hackday session)Java 9 / Jigsaw - LJC / VJUG session (hackday session)
Java 9 / Jigsaw - LJC / VJUG session (hackday session)Mani Sarkar
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules uploadRyan Cuprak
 
Jax london 2011
Jax london 2011Jax london 2011
Jax london 2011njbartlett
 
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil BartlettJava Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil BartlettJAX London
 
Java Platform Module System
Java Platform Module SystemJava Platform Module System
Java Platform Module SystemVignesh Ramesh
 
AS7/OSGi One Day Talk 2012
AS7/OSGi One Day Talk 2012AS7/OSGi One Day Talk 2012
AS7/OSGi One Day Talk 2012tdiesler
 
Java 9 New Features
Java 9 New FeaturesJava 9 New Features
Java 9 New FeaturesAli BAKAN
 
OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)David Bosschaert
 
Moved to https://slidr.io/azzazzel/what-s-not-new-in-modular-java
Moved to https://slidr.io/azzazzel/what-s-not-new-in-modular-javaMoved to https://slidr.io/azzazzel/what-s-not-new-in-modular-java
Moved to https://slidr.io/azzazzel/what-s-not-new-in-modular-javaMilen Dyankov
 

Similaire à Java modularization (20)

Java modulesystem
Java modulesystemJava modulesystem
Java modulesystem
 
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
Modularity of the Java Platform (OSGi, Jigsaw and Penrose)
 
Java 9 / Jigsaw - AJUG/VJUG session
Java 9 / Jigsaw - AJUG/VJUG  sessionJava 9 / Jigsaw - AJUG/VJUG  session
Java 9 / Jigsaw - AJUG/VJUG session
 
Java 9, JShell, and Modularity
Java 9, JShell, and ModularityJava 9, JShell, and Modularity
Java 9, JShell, and Modularity
 
Java 9: Deep Dive into Modularity and Dealing with Migration Issues
Java 9: Deep Dive into Modularity and Dealing with Migration IssuesJava 9: Deep Dive into Modularity and Dealing with Migration Issues
Java 9: Deep Dive into Modularity and Dealing with Migration Issues
 
Java 9 Jigsaw HackDay
Java 9 Jigsaw HackDayJava 9 Jigsaw HackDay
Java 9 Jigsaw HackDay
 
Enabling modularization through OSGi and SpringDM
Enabling modularization through OSGi and SpringDMEnabling modularization through OSGi and SpringDM
Enabling modularization through OSGi and SpringDM
 
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
Modules in Java? Finally! (OpenJDK 9 Jigsaw, JSR376)
 
Java 9 / Jigsaw - LJC / VJUG session (hackday session)
Java 9 / Jigsaw - LJC / VJUG session (hackday session)Java 9 / Jigsaw - LJC / VJUG session (hackday session)
Java 9 / Jigsaw - LJC / VJUG session (hackday session)
 
Preparing for java 9 modules upload
Preparing for java 9 modules uploadPreparing for java 9 modules upload
Preparing for java 9 modules upload
 
Javantura v4 - What’s NOT new in modular Java - Milen Dyankov
Javantura v4 - What’s NOT new in modular Java - Milen DyankovJavantura v4 - What’s NOT new in modular Java - Milen Dyankov
Javantura v4 - What’s NOT new in modular Java - Milen Dyankov
 
Jax london 2011
Jax london 2011Jax london 2011
Jax london 2011
 
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil BartlettJava Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
Java Core | Java 8 and OSGi Modularisation | Tim Ellison & Neil Bartlett
 
Java Platform Module System
Java Platform Module SystemJava Platform Module System
Java Platform Module System
 
AS7/OSGi One Day Talk 2012
AS7/OSGi One Day Talk 2012AS7/OSGi One Day Talk 2012
AS7/OSGi One Day Talk 2012
 
Java 9 New Features
Java 9 New FeaturesJava 9 New Features
Java 9 New Features
 
Java8 - Under the hood
Java8 - Under the hoodJava8 - Under the hood
Java8 - Under the hood
 
OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)OpenJDK Penrose Presentation (JavaOne 2012)
OpenJDK Penrose Presentation (JavaOne 2012)
 
OSGi introduction
OSGi introductionOSGi introduction
OSGi introduction
 
Moved to https://slidr.io/azzazzel/what-s-not-new-in-modular-java
Moved to https://slidr.io/azzazzel/what-s-not-new-in-modular-javaMoved to https://slidr.io/azzazzel/what-s-not-new-in-modular-java
Moved to https://slidr.io/azzazzel/what-s-not-new-in-modular-java
 

Dernier

Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfMarharyta Nedzelska
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLionel Briand
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 

Dernier (20)

Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
A healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdfA healthy diet for your Java application Devoxx France.pdf
A healthy diet for your Java application Devoxx France.pdf
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Large Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and RepairLarge Language Models for Test Case Evolution and Repair
Large Language Models for Test Case Evolution and Repair
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 

Java modularization

  • 2. 1 What is NOT modularity ? 2 So, what is modularity then ? 3 Why use modularity ? 4 Implementations of modularity 5 OSGi 6 Jigsaw 7 Jigsaw vs Osgi 8 References
  • 3. What is NOT modularity ?
  • 4. compile time runtime What is NOT modularity ? Monolithic system • One piece • No subcomponents • Tight coupling • No independent existence • Growing functionality and interdependence
  • 5. so, what is modularity then ?
  • 6. What is Modularity ? • Module : • Every single deployable unit • Design technique that emphasises separating the functionality into modules that are : • Independent • Interchangeable • One functionality
  • 8. Java Modularity - Why ? • Pros • Louse coupling • Optimise development • Escalation and evolution • Reuse • Ease testing
  • 9. Java Modularity - Why ? • Cons • Adds tracking complexity • Needs more good code practices • Forces us to consider more flexibility • Think about collateral effects • May add architecture complexity
  • 10. Java Modularity - Implementations
  • 11. Java Modularity - Implementations  SOA, micro-services  OSGi  Dynamic modularity  Module lifecycle  Service discovery  Package security  Package versioning  Jigsaw  Static modularity  Mainly to create JRE subset  Initially for small devices
  • 13. Java Modularity - OSGi  Started in 1998  Different implementations : Equinox, Felix, Knoplerfish, Karaf, Fabric8, Netbinox  Current specs OSGi Alliance release 6.0  Every bundle ( module )  Its own class loader  Its own lifecycle  Service discovery  Dynamic loading (lazy, eager activation)  Meta information included in META-INF file  Used in : Eclipse IDE, Netbeans IDE, Glassfish, WildFly, Adobe AEM ( Sling )
  • 15. Java Modularity - Jigsaw  Started in 2014  In Early Access now, or final release in JDK 9 in 2017  Explicit declaration of  Importing modules  Exporting packages  Meta info in module-info.java file  Module names must be unique  Not includes versioning  Introduce a new artifact format : JMOD
  • 16. Java Modularity - Jigsaw Modules dependencies in Jigsaw com.foo.app com.foo.app.api com.foo.app.report java.sql java.logging java.base can not read depends java.xml reads com.foo.other depends reads depends & publishes
  • 17. Java Modularity - Jigsaw Module specification : module com.foo.bar { // module definition requires com.foo.baz; // module needed exports com.foo.bar.alpha; // package published exports com.foo.bar.beta to // package published ONLY com.foo.client, // to these modules com.foo.reporter; provides com.foo.api.MyInterface with // publishing a service com.foo.impl.MyImpl; uses com.foo.api.YourInterface; // consuming a service requires public com.slf4j; // module needed AND // made readable to everyone // who requires this module com.foo.bar }
  • 18. Java Modularity - Jigsaw / OSGi
  • 19. Java Modularity - Jigsaw Main differences Jigsaw OSGi Module dependency Java package dependency Version agnostic ( only 1 allowed ) Version capable ( lots of versions loaded at the same time ) No lifecycle management Lifecycle management Export constraints No export constraints Static modularity at deployment Dynamic modularity at deploy + runtime
  • 20. Java Modularity - References
  • 21. Java Modularity - bloggers Peter Kriens @pkriens Neil Bartlett @nbartlett Paul Bakker @pbakker JB Onofre @jbonofre Mark Reinhold @mreinhold
  • 22. Java Modularity - References About Modularity ( monoliths / modular ) http://www.codingthearchitecture.com/2014/11/19/what_is_a_monolith.html http://c2.com/cgi/wiki?MonolithicDesign https://en.wikipedia.org/wiki/Modular_programming About OSGi https://www.osgi.org/developer/specifications/ ( specs ) http://njbartlett.name/files/osgibook_preview_20091217.pdf ( free old book ) About Jigsaw http://openjdk.java.net/projects/jigsaw/ ( specs ) http://njbartlett.name/2015/11/13/osgi-jigsaw.html https://www.youtube.com/watch?v=y8bpKYDrF5I https://www.youtube.com/watch?v=UKC0uC7QUkI ( Mark’s Devoxx Talk )
  • 23. Java Modularity - Books Non modularity books Martin FowlerGoF Paul Bakker Richard S. Hall Achim Nierbeck
  • 24. Thank you…. and happy coding !!!

Notes de l'éditeur

  1. hi, thank you for coming in this presentation I will try to show some basic concepts about modularity, and specially in Java well, first of all I would want to thank you all the people that have helped to refine this presentation with their comments, thank you.
  2. this is the agenda I will try to cover during the talk, from the definition of concepts to detail of some implementations and finally comparing those implementations
  3. if we want to talk about java modularity first we should start defining what is modularity but instead I will start defining what is NOT modularity because we have to recognise the differences
  4. *so, the contrary of a modular application would be a monolithic application *having the image of a monolith as a single giant block of stone or metal *these are some characteristics that a monolithic system can have : —made in only one deployable piece —it doesn't have subcomponents that we can deliver separately —if we have different parts in our app but we still have tight coupling between those parts we will have a monolith also —another characteristic of a monolithic system could be that its parts don't have existence apart from the other parts —and finally we can end in a monolithic system if during the time of development we have grown the functionality and the interdependence between the parts at the same time
  5. then now , we know what is NOT modularity, so lets see what could be one description of what is modularity
  6. * first, I will describe what a module could be, and in this case I consider a module as every deployable unit that your compilation creates and here we have a description of what modularity could be : a design technique where we invest effort in creating different models that are : —- independent because they can run separately —- interchángebol because they work using contracts and we can replace them with other modules —- and with limited functionality for every module to ease the separation of concerns as I said this is the ideal situation, maybe reality could be different
  7. now we come to what are the benefits of using modularity and maybe also what are the drawbacks of using it
  8. so some of the pros that we can find using modularity are : * that it helps to louse coupling because we separate the logical parts of the system into modules and for that we work using contracts * also it can help optimising development because teams can work “separately” without waiting one team for another to finish their code * also it may ease the escalation and evolution of the application as we can evolute a single module without “affecting” the rest of the system * also it forces us to reuse modules due to the single functionality principle * and finally we can test every module more easily without having a lot of parts interconnected
  9. but also we can find some drawbacks that we should consider if we adopt this pattern: * one of them is that it adds more tracking complexity because instead of tracking one deployable unit you have to deal with several , specially for versions * also it needs us to be more accurate with our code practices to avoid repeating code, to keep independence * in some cases we also have to consider more flexibility because we will have different typologies of module consumers and also restrict the collateral effects that they can cause to the system * and finally we can end with more architecture complexity because of the protocols we need to interconnect the modules, runtimes where deploy them and the formats to define the modules
  10. so now that we know what is and what is not modularity we are going to see some of the implementation we can find out there
  11. first we can see 2 implementations that are famous, everyone for different reasons. * SOA as an architectural design that converts your system into a lot of web services with different elements that provide interconection, security, balance, etc *also we have micro services, that nowadays is very trendy and it claims to be an evolution and radical improvement of SOA where you split your app into modules that have nothing in common with the other micro services not sharing even the persistence layer nor the coding language *then we have the two implementations that motivated this presentation —OSGi as an implementation considering the compile and runtime modularity, having module lifecycle control, service discovery and injection, restriction of the visibility for the public packages, and also the ability to manage different version of the same package at the same time —and finally Jigsaw as a way to modularise your app ( and the JRE ) creating smaller modules that you can combine at the delivery time it was created initially to reduce the JRE delivering only the needed libraries and its now expected to come to life the next year
  12. I will try to briefly describe the last two implementations, OSGi and Jigsaw And I will start with OSGi giving a fast introduction to it just to describe a bit deeper Jigsaw and see the main differences people searches in google are always curious, don't you think ?
  13. well, OSGi started 18 years ago and is present in some of the most used apps among developers there are some implementations but basically are Felix and Equinox and the rest can run one of them and add some enterprise features actually the last release is the 6.0 released in 2014 every bundle in the system has its own class loader and we an control the lifecycle of every bundle independently it has a service registry where any service can be registered and later any managed class can query that registry and inject the required service also we can configure those osgi components to be loaded and activated at start time or at the moment they are needed by other modules the information about exporting and importing packages is included inside the meta-ind file, although all of us use bnd maven plugin to generate that meta info on the compilation time.
  14. now we move to see what is jigsaw apart from a movie character and a game….
  15. its an oracle project related to the JDK that now is in early access and will be final released next year it defines explicit declaration for importing modules and exporting packages , including constraining the destination module uses the module-info.java file to define the module does not cover the module versioning as we’ve seen with OSGi and introduces a new artefact call JMOD that includes .jar, config files, and documentation also it has a default module for non defined modules called unnamed and it does not consider the lifecycle of the modules as it does OSGi
  16. here is just a simple case of dependencies introducing the concept of modules in this example we have our com.foo.app module with 2 packages inside, an api package exported and a report package not exported it depends on java.sql and is capable to read the exported packages of it, but its not capable to read anything inside java.logging , there is no transitive readability and to solve that we can explicitly define a dependency as public…the case with java.xml
  17. in this example we can see a declaration file for a module with the elements to describe the dependencies : requires, exports, exports to, provides, uses and requires public
  18. so, now we have seen some characteristics of jigsaw and osgi and as a fast comparative we will see a table with the main facts
  19. while jigsaw have dependencies at a module level, in osgi that dependencies are at a package level no matter the module where they are. also jigsaw is version agnostic and for that we can not have 2 different versions of the same module running together jigsaw also is not intended to control the lifecycle of any module with jigsaw we find that we can constraint with who a module is sharing a package and finally jigsaw is intended to generate a modularity at deployment time having several tiny parts of the code, but in OSGi we have that modularity in the runtime also thanks to the container
  20. well, I would like to end this presentation showing some references that may help those of you who want to know more about this topic.
  21. these are some of the people that post often about OSGi and Jigsaw. Peter as principal member of the OSGi Alliance and Neil as an OSGi expert and maintainer of the BND Tools. Also we have Paul Bakker as a constant blogger about OSGi and creator of Amdatu, a list of tools to create modular apps with OSGi. We also have JeanBaptiste as the PMC of the Apache Karaf project, an OSGi container with more features. And finally we have Mark Reinhold as the Chief Architect of the Java platform at Oracle.
  22. here i’ve put some links for every main subject including the Devoxx Talk by Mark Reinhold about jigsaw that I was proud to assist last November.
  23. and finally here you can see some books that could help when considering modularity as a design for your apps. I’ve included also 2 sci-fi books about generated realities… just because I like them a lot.
  24. well, thats all from my side ( as we say every morning ) hope you have enjoyed the presentation… and if you have easy questions, please go shoot me.