SlideShare a Scribd company logo
1 of 44
Download to read offline
JIGSAW
Piotr Stawirej|@p_stawirej|Java Beyond Jigsaw
JIGSAW
Piotr Stawirej|@p_stawirej|4Developers 2018
Piotr Stawirej|@p_stawirej|4Developers 2018
Modularity
Piotr Stawirej|@p_stawirej|4Developers 2018
Modularity
• Make the Java SE Platform, and the JDK,
more easily scalable down to small
computing devices
• Improve
• security
• maintainability
• performance
• A module system for application developers
• Hide platform internals (e.g. sun.misc)
• Reliable application composition
Piotr Stawirej|@p_stawirej|4Developers 2018
Modularity
Piotr Stawirej|@p_stawirej|4Developers 2018
Modularity Example
Piotr Stawirej|@p_stawirej|4Developers 2018
Modularity Example
Piotr Stawirej|@p_stawirej|4Developers 2018
Modularity Example
Piotr Stawirej|@p_stawirej|4Developers 2018
Modularity Example
Piotr Stawirej|@p_stawirej|4Developers 2018
Modularity Example
Piotr Stawirej|@p_stawirej|4Developers 2018
Modularity Example
Piotr Stawirej|@p_stawirej|4Developers 2018
Example Design
API
Piotr Stawirej|@p_stawirej|4Developers 2018
Example Design
s
API
Earth Mars
Piotr Stawirej|@p_stawirej|4Developers 2018
Example Design
s
Elon
API
Earth Mars
Piotr Stawirej|@p_stawirej|4Developers 2018
Implied Readibility - transitive
API
Earth Mars
Elon
Piotr Stawirej|@p_stawirej|4Developers 2018
Qualified Exports – exports to
API
Earth Mars
Elon Jeff
Piotr Stawirej|@p_stawirej|4Developers 2018
Qualified Exports – exports to
API
Earth Mars
Elon Jeff
Piotr Stawirej|@p_stawirej|4Developers 2018
Services
API
Earth Mars
Piotr Stawirej|@p_stawirej|4Developers 2018
Services
API
Earth Mars
Piotr Stawirej|@p_stawirej|4Developers 2018
Services
API
Earth Mars
Elon
Piotr Stawirej|@p_stawirej|4Developers 2018
Services
Elon
Piotr Stawirej|@p_stawirej|4Developers 2018
Services – factory method
Elon
Piotr Stawirej|@p_stawirej|4Developers 2018
Services – factory method
API Mars
Earth
Piotr Stawirej|@p_stawirej|4Developers 2018
Service Selection
Piotr Stawirej|@p_stawirej|4Developers 2018
Service Selection
Piotr Stawirej|@p_stawirej|4Developers 2018
Service Selection
Piotr Stawirej|@p_stawirej|4Developers 2018
Compile-Time Dependencies
Elon
API
Pluto
Piotr Stawirej|@p_stawirej|4Developers 2018
Transitive Static?
• Services are better for optional dependencies
• For enabling modularization of legacy code
• Put responsibility on consumer to verify API
Piotr Stawirej|@p_stawirej|4Developers 2018
Deep Reflection
`
API
Elon
Earth
core
<<package>>
Oceans
<<class>>
Piotr Stawirej|@p_stawirej|4Developers 2018
Deep Reflection
`
API
Elon
Earth
core
<<package>>
Oceans
<<class>>
java.lang.IllegalAccessException: class user.elon.Elon
(in module module.elon) cannot access class planet.core.EarthCore
(in module module.earth) because module module.earth
does not export planet.core to module module.elon
java.lang.reflect.InaccessibleObjectException:
Unable to make public java.lang.String planet.earth.Oceans.oceans()
accessible: module module.earth does not "opens planet.earth"
to module module.elon
Piotr Stawirej|@p_stawirej|4Developers 2018
Deep Reflection
`
API
Elon
Earth
core
<<package>>
Oceans
<<class>>
Piotr Stawirej|@p_stawirej|4Developers 2018
Deep Reflection
`
API
Elon
Earth
core
<<package>>
Oceans
<<class>>
Piotr Stawirej|@p_stawirej|4Developers 2018
Deep Reflection
`
API
Elon
Earth
core
<<package>>
Oceans
<<class>>
Piotr Stawirej|@p_stawirej|4Developers 2018
Compile, Package, Link
Piotr Stawirej|@p_stawirej|4Developers 2018
Compile, Package, Link
Piotr Stawirej|@p_stawirej|4Developers 2018
Compile, Package, Link
binjava.exe --list-modules
java.base@10
module.api
module.earth
module.elon
module.mars
jar -d --file=elon.jar
exports user.elon
requires java.base mandated
requires module.earth
requires module.mars
Piotr Stawirej|@p_stawirej|4Developers 2018
Package, Link, Versioning
Package
• Dependencies are transitively resolved on modulepath not classpath
Link
• Uses explicit dependencies from module-info.class
• We know which modules are going to be run
• Aggressive optimizations
Versioning
• Modules resolved purely by name
• Module version is only attribute
• Use e.g. Maven, Gradle
Piotr Stawirej|@p_stawirej|4Developers 2018
Java Modular vs OSGi
Module vs package dependencies
• Module dependency: depend on a module, no matter what’s in it
• Package dependencies still exists in code (imports)
• Package dependency: depend on a package,
no matter where it comes from
• Better decoupling
Piotr Stawirej|@p_stawirej|4Developers 2018
Java Modular vs OSGi
Module vs package dependencies
Piotr Stawirej|@p_stawirej|4Developers 2018
Java Modular vs OSGi
Java exported packages
• Exported packages only visible to predefined „friend modules”
• Necessary to split up JDK
• Only one module may export a given package to another module
Piotr Stawirej|@p_stawirej|4Developers 2018
Java Modular vs OSGi
Services
Services OSGi
• Services are explicit in module metadata
• No lifecycle
• But can be loaded at run-time
• Services wired programmatically
• Service dynamics and bundle lifecycle
• Services can have properties, filters
Piotr Stawirej|@p_stawirej|4Developers 2018
How could the future look like?
`
Piotr Stawirej|@p_stawirej|4Developers 2018
`
Thank You!
https://bitbucket.org/piotrstawirej/java-module
http://piotrstawirej.bitbucket.io
@p_stawirej
Piotr Stawirej|@p_stawirej|4Developers 2018

More Related Content

What's hot

What's hot (11)

Super-powered CI with Git - Sarah Goff-Dupont
Super-powered CI with Git - Sarah Goff-DupontSuper-powered CI with Git - Sarah Goff-Dupont
Super-powered CI with Git - Sarah Goff-Dupont
 
Spring Boot Interview Questions | Edureka
Spring Boot Interview Questions | EdurekaSpring Boot Interview Questions | Edureka
Spring Boot Interview Questions | Edureka
 
ATAGTR2017 Machine Learning telepathy for Shift Right approach of testing
ATAGTR2017 Machine Learning telepathy for Shift Right approach of testingATAGTR2017 Machine Learning telepathy for Shift Right approach of testing
ATAGTR2017 Machine Learning telepathy for Shift Right approach of testing
 
DevOps Architecture Design
DevOps Architecture DesignDevOps Architecture Design
DevOps Architecture Design
 
The Long Walk to Apache NetBeans
The Long Walk to Apache NetBeansThe Long Walk to Apache NetBeans
The Long Walk to Apache NetBeans
 
Final ppt
Final pptFinal ppt
Final ppt
 
DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)
DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)
DevOps:建造開發維運的跨界之橋 (@ C.C. Agile #37)
 
#ATAGTR2018 Presentation " Security Testing for RESTful APIs" By Anuradha Raman
#ATAGTR2018 Presentation " Security Testing for RESTful APIs" By Anuradha Raman #ATAGTR2018 Presentation " Security Testing for RESTful APIs" By Anuradha Raman
#ATAGTR2018 Presentation " Security Testing for RESTful APIs" By Anuradha Raman
 
It's all about feedback - code review as a great tool in the agile toolbox
It's all about feedback - code review as a great tool in the agile toolboxIt's all about feedback - code review as a great tool in the agile toolbox
It's all about feedback - code review as a great tool in the agile toolbox
 
Java Desktop 2019
Java Desktop 2019Java Desktop 2019
Java Desktop 2019
 
Session on Testing Activities in Continuous Integration and Delivery as an Ex...
Session on Testing Activities in Continuous Integration and Delivery as an Ex...Session on Testing Activities in Continuous Integration and Delivery as an Ex...
Session on Testing Activities in Continuous Integration and Delivery as an Ex...
 

Similar to 4Developers 2018: Java 9 - beyond Jigsaw (Piotr Stawirej)

SUGCON: The Agile Nirvana of DevSecOps and Containerization
SUGCON: The Agile Nirvana of DevSecOps and ContainerizationSUGCON: The Agile Nirvana of DevSecOps and Containerization
SUGCON: The Agile Nirvana of DevSecOps and Containerization
Vasiliy Fomichev
 

Similar to 4Developers 2018: Java 9 - beyond Jigsaw (Piotr Stawirej) (20)

Spring Interview Questions and Answers | Spring Tutorial | Spring Framework T...
Spring Interview Questions and Answers | Spring Tutorial | Spring Framework T...Spring Interview Questions and Answers | Spring Tutorial | Spring Framework T...
Spring Interview Questions and Answers | Spring Tutorial | Spring Framework T...
 
Modularization in java 8
Modularization in java 8Modularization in java 8
Modularization in java 8
 
JSF 2.3 Adopt-a-JSR 10 Minute Infodeck
JSF 2.3 Adopt-a-JSR 10 Minute InfodeckJSF 2.3 Adopt-a-JSR 10 Minute Infodeck
JSF 2.3 Adopt-a-JSR 10 Minute Infodeck
 
Java REST API Framework Comparison - PWX 2021
Java REST API Framework Comparison - PWX 2021Java REST API Framework Comparison - PWX 2021
Java REST API Framework Comparison - PWX 2021
 
Lightweight J2EE development with Spring (special for UADEV)
Lightweight J2EE development with Spring (special for UADEV)Lightweight J2EE development with Spring (special for UADEV)
Lightweight J2EE development with Spring (special for UADEV)
 
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
Java REST API Comparison: Micronaut, Quarkus, and Spring Boot - jconf.dev 2020
 
Polymer - Welcome to the Future @ PyGrunn 08/07/2014
Polymer - Welcome to the Future @ PyGrunn 08/07/2014Polymer - Welcome to the Future @ PyGrunn 08/07/2014
Polymer - Welcome to the Future @ PyGrunn 08/07/2014
 
DEVBCN_Jakarta EE! The future of enterprise application behind the myths. _Al...
DEVBCN_Jakarta EE! The future of enterprise application behind the myths.
_Al...DEVBCN_Jakarta EE! The future of enterprise application behind the myths.
_Al...
DEVBCN_Jakarta EE! The future of enterprise application behind the myths. _Al...
 
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
 
Comparing Native Java REST API Frameworks - Devoxx France 2022
Comparing Native Java REST API Frameworks - Devoxx France 2022Comparing Native Java REST API Frameworks - Devoxx France 2022
Comparing Native Java REST API Frameworks - Devoxx France 2022
 
Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021Java REST API Framework Comparison - UberConf 2021
Java REST API Framework Comparison - UberConf 2021
 
Getting Groovy with JHipster and Micronaut
Getting Groovy with JHipster and MicronautGetting Groovy with JHipster and Micronaut
Getting Groovy with JHipster and Micronaut
 
Spring framework core
Spring framework coreSpring framework core
Spring framework core
 
Sitecore Install Extensions in Action
Sitecore Install Extensions in ActionSitecore Install Extensions in Action
Sitecore Install Extensions in Action
 
Front End Development for Back End Java Developers - NYJavaSIG 2019
Front End Development for Back End Java Developers - NYJavaSIG 2019Front End Development for Back End Java Developers - NYJavaSIG 2019
Front End Development for Back End Java Developers - NYJavaSIG 2019
 
Comparing Native Java REST API Frameworks - Seattle JUG 2022
Comparing Native Java REST API Frameworks - Seattle JUG 2022Comparing Native Java REST API Frameworks - Seattle JUG 2022
Comparing Native Java REST API Frameworks - Seattle JUG 2022
 
SUGCON: The Agile Nirvana of DevSecOps and Containerization
SUGCON: The Agile Nirvana of DevSecOps and ContainerizationSUGCON: The Agile Nirvana of DevSecOps and Containerization
SUGCON: The Agile Nirvana of DevSecOps and Containerization
 
Jigsaw modularity
Jigsaw modularityJigsaw modularity
Jigsaw modularity
 
Landscape of Eclipse MicroProfile Tools
Landscape of Eclipse MicroProfile ToolsLandscape of Eclipse MicroProfile Tools
Landscape of Eclipse MicroProfile Tools
 
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
Java EE 8 Adopt a JSR : JSON-P 1.1 & MVC 1.0
 

Recently uploaded

EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

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
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 

4Developers 2018: Java 9 - beyond Jigsaw (Piotr Stawirej)