SlideShare a Scribd company logo
Java 9 Modularity +
Ivelin Yanev
What is modular architecture?
https://www.nasa.gov/mission_pages/station/structure/elements/space-station-assembly
What is a module?
“deployable, manageable, natively reusable, composable, stateless unit of software that
provides a concise interface to consumers” - Kirkk Knoerchild
https://en.wikipedia.org/wiki/Harmony_(ISS_module)
Modules must adhere to three core tenets
● Strong encapsulation - encapsulated code may change freely without
affecting users of the module.
● Well-defined interfaces - modules have to work together.
● Explicit dependencies - it provides the basis for a reliable configuration of
modules.
Modules vs. microservices
“Microservices are small, autonomous services
that work together”
Advantages:
❏ Independent development
❏ Failure isolation
❏ Independent choice of technology
❏ Ease of deployment
❏ Easy to understand
❏ ……….
Modules vs. microservices
Disadvantages:
❏ Testing problem
❏ Network communication can affect stability
❏ Refactoring is not easy
❏ Difficult to find systematic problems
❏ Service synchronization
❏ Complexity of managing a large number of services
Modules vs. microservices
Problem with monolithic Java
http://openjdk.java.net/projects/jigsaw/doc/jdk-modularization.htm
Problem with monolithic Java
● The first major release of the JDK had a little over 500 public classes.
● JDK 8 has 4,200 public classes and over 20,000 total files.
● rt.jar is more than 60 megabytes.
“Java on small devices”
Classpath Hell
● Unexpressed Dependencies
● Version Conflicts
● Complex Class Loading
More problems...
● Internal APIs - sun.* and jdk.internal.*
● Cyclic dependencies
● Legacy classes - CORBA
● Startup Performance
● Security
Module systems
● OSGi - Open Services Gateway initiative
● Java 9 - Project Jigsaw(JPMS)
Strong encapsulation Well-defined interfaces
Explicit dependencies
Module systems
The Modular JDK
http://shazsterblog.blogspot.com/2017/08/
Change Of JDK/JRE Binary Structure
In Java 8 the rt.jar measures close to 60
MB in size
https://www.developer.com/java/java-9-structural-changes-in-the-jdk-a
nd-jre.html
The java.base module
java.base
java.lang
java.io
java.net
java.util
com.sun.crypto.provider
sun.nio.ch
sun.reflect.annotation
sun.security.provider
● Exports: the list of all the packages exported by
the module
● Contains: this is the list of internal packages
● Requires: this is the list of modules that a given
module requires
Module Definition
<open> module <module-name> {
[export <java package> [to <module name>]
[requires [transitive] <module-name>]
[opens <module name> [to <module name]]
[provides <interface> with <implementation>]
[uses <interface>]
}
Module Meta Data
● Module names must be unique
● Requires- indicates that this module depends on another module
Module Meta Data
● Requires Static - this is an optional dependency. The module is needed at
compile time, but not at runtime.
Module Meta Data
● Requires Transitive - this means that any module that reads your module
implicitly also reads the transitive module.
Module Meta Data
● Exports - by default, a module doesn’t expose any of its API to other modules.
● Exports …. To - we can restrict which modules have access to our APIs.
Module Meta Data
● Uses - our module consumes the current service.
● Provides … With
The problem of coupling
Service
Registry
Provider
Module
Consumer
Module
Register
Service
LookUp Service
Return Service
Instance
Demo

More Related Content

Similar to Java 9 modularity+ (20)

PDF
Java 9 Jigsaw HackDay
Oleg Tsal-Tsalko
 
PDF
What's My Modularity
Bob Paulin
 
PPT
Java 9 Module System
Hasan Ünal
 
PDF
Java 9 / Jigsaw - AJUG/VJUG session
Mani Sarkar
 
PPTX
Java Modularity with OSGi
Ilya Rybak
 
PPTX
Dynamic Groovy Edges
Jimmy Ray
 
PDF
What's new in java 9?
Trayan Iliev
 
PDF
Java training noida hibernate+spring+struts+web services(1)
miracleindia
 
PDF
Nine Neins - where Java EE will never take you
Markus Eisele
 
PPTX
Preparing for java 9 modules upload
Ryan Cuprak
 
PDF
Java Future S Ritter
catherinewall
 
PPTX
Java modules using project jigsaw@jdk 9
Mauricio "Maltron" Leal
 
PDF
A presentationon SPRING-BOOT and CRUD operation
AbhijiteDebBarman
 
PDF
Eclipse plug in development
Martin Toshev
 
PPTX
JavaScript Module Loaders
zeroproductionincidents
 
PDF
Framework adoption for java enterprise application development
Clarence Ho
 
PPT
Object Oriented Methodology in Java (Lecture-1)
Md. Mujahid Islam
 
PPTX
Chapter 10:Understanding Java Related Platforms and Integration Technologies
It Academy
 
PDF
Lec 2 30_jul13
Palak Sanghani
 
PPTX
Design principles to modularise a monolith codebase.pptx
Prashant Kalkar
 
Java 9 Jigsaw HackDay
Oleg Tsal-Tsalko
 
What's My Modularity
Bob Paulin
 
Java 9 Module System
Hasan Ünal
 
Java 9 / Jigsaw - AJUG/VJUG session
Mani Sarkar
 
Java Modularity with OSGi
Ilya Rybak
 
Dynamic Groovy Edges
Jimmy Ray
 
What's new in java 9?
Trayan Iliev
 
Java training noida hibernate+spring+struts+web services(1)
miracleindia
 
Nine Neins - where Java EE will never take you
Markus Eisele
 
Preparing for java 9 modules upload
Ryan Cuprak
 
Java Future S Ritter
catherinewall
 
Java modules using project jigsaw@jdk 9
Mauricio "Maltron" Leal
 
A presentationon SPRING-BOOT and CRUD operation
AbhijiteDebBarman
 
Eclipse plug in development
Martin Toshev
 
JavaScript Module Loaders
zeroproductionincidents
 
Framework adoption for java enterprise application development
Clarence Ho
 
Object Oriented Methodology in Java (Lecture-1)
Md. Mujahid Islam
 
Chapter 10:Understanding Java Related Platforms and Integration Technologies
It Academy
 
Lec 2 30_jul13
Palak Sanghani
 
Design principles to modularise a monolith codebase.pptx
Prashant Kalkar
 

More from Ivelin Yanev (11)

PDF
Quarkus Extensions Turbocharge for Java Microservices.pdf
Ivelin Yanev
 
PDF
Empowering Your Java Applications with Quarkus. A New Era of Fast, Efficient,...
Ivelin Yanev
 
PDF
Project Loom
Ivelin Yanev
 
PPTX
Building flexible ETL pipelines with Apache Camel on Quarkus
Ivelin Yanev
 
PDF
Git collaboration
Ivelin Yanev
 
PDF
Java exeptions
Ivelin Yanev
 
PDF
Introducing java oop concepts
Ivelin Yanev
 
PDF
Introducing generic types
Ivelin Yanev
 
PDF
Java features. Java 8, 9, 10, 11
Ivelin Yanev
 
PDF
Design principles
Ivelin Yanev
 
PDF
Intoduction Internet of Things
Ivelin Yanev
 
Quarkus Extensions Turbocharge for Java Microservices.pdf
Ivelin Yanev
 
Empowering Your Java Applications with Quarkus. A New Era of Fast, Efficient,...
Ivelin Yanev
 
Project Loom
Ivelin Yanev
 
Building flexible ETL pipelines with Apache Camel on Quarkus
Ivelin Yanev
 
Git collaboration
Ivelin Yanev
 
Java exeptions
Ivelin Yanev
 
Introducing java oop concepts
Ivelin Yanev
 
Introducing generic types
Ivelin Yanev
 
Java features. Java 8, 9, 10, 11
Ivelin Yanev
 
Design principles
Ivelin Yanev
 
Intoduction Internet of Things
Ivelin Yanev
 
Ad

Recently uploaded (20)

PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PPTX
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
PPTX
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PPTX
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
PDF
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
PDF
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
Empowering Asian Contributions: The Rise of Regional User Groups in Open Sour...
Shane Coughlan
 
Home Care Tools: Benefits, features and more
Third Rock Techkno
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
AEM User Group: India Chapter Kickoff Meeting
jennaf3
 
Empower Your Tech Vision- Why Businesses Prefer to Hire Remote Developers fro...
logixshapers59
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
vMix Pro 28.0.0.42 Download vMix Registration key Bundle
kulindacore
 
Odoo CRM vs Zoho CRM: Honest Comparison 2025
Odiware Technologies Private Limited
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Ad

Java 9 modularity+

  • 1. Java 9 Modularity + Ivelin Yanev
  • 2. What is modular architecture? https://www.nasa.gov/mission_pages/station/structure/elements/space-station-assembly
  • 3. What is a module? “deployable, manageable, natively reusable, composable, stateless unit of software that provides a concise interface to consumers” - Kirkk Knoerchild https://en.wikipedia.org/wiki/Harmony_(ISS_module)
  • 4. Modules must adhere to three core tenets ● Strong encapsulation - encapsulated code may change freely without affecting users of the module. ● Well-defined interfaces - modules have to work together. ● Explicit dependencies - it provides the basis for a reliable configuration of modules.
  • 5. Modules vs. microservices “Microservices are small, autonomous services that work together” Advantages: ❏ Independent development ❏ Failure isolation ❏ Independent choice of technology ❏ Ease of deployment ❏ Easy to understand ❏ ……….
  • 6. Modules vs. microservices Disadvantages: ❏ Testing problem ❏ Network communication can affect stability ❏ Refactoring is not easy ❏ Difficult to find systematic problems ❏ Service synchronization ❏ Complexity of managing a large number of services
  • 8. Problem with monolithic Java http://openjdk.java.net/projects/jigsaw/doc/jdk-modularization.htm
  • 9. Problem with monolithic Java ● The first major release of the JDK had a little over 500 public classes. ● JDK 8 has 4,200 public classes and over 20,000 total files. ● rt.jar is more than 60 megabytes. “Java on small devices”
  • 10. Classpath Hell ● Unexpressed Dependencies ● Version Conflicts ● Complex Class Loading
  • 11. More problems... ● Internal APIs - sun.* and jdk.internal.* ● Cyclic dependencies ● Legacy classes - CORBA ● Startup Performance ● Security
  • 12. Module systems ● OSGi - Open Services Gateway initiative ● Java 9 - Project Jigsaw(JPMS) Strong encapsulation Well-defined interfaces Explicit dependencies
  • 15. Change Of JDK/JRE Binary Structure In Java 8 the rt.jar measures close to 60 MB in size https://www.developer.com/java/java-9-structural-changes-in-the-jdk-a nd-jre.html
  • 16. The java.base module java.base java.lang java.io java.net java.util com.sun.crypto.provider sun.nio.ch sun.reflect.annotation sun.security.provider ● Exports: the list of all the packages exported by the module ● Contains: this is the list of internal packages ● Requires: this is the list of modules that a given module requires
  • 17. Module Definition <open> module <module-name> { [export <java package> [to <module name>] [requires [transitive] <module-name>] [opens <module name> [to <module name]] [provides <interface> with <implementation>] [uses <interface>] }
  • 18. Module Meta Data ● Module names must be unique ● Requires- indicates that this module depends on another module
  • 19. Module Meta Data ● Requires Static - this is an optional dependency. The module is needed at compile time, but not at runtime.
  • 20. Module Meta Data ● Requires Transitive - this means that any module that reads your module implicitly also reads the transitive module.
  • 21. Module Meta Data ● Exports - by default, a module doesn’t expose any of its API to other modules. ● Exports …. To - we can restrict which modules have access to our APIs.
  • 22. Module Meta Data ● Uses - our module consumes the current service. ● Provides … With
  • 23. The problem of coupling Service Registry Provider Module Consumer Module Register Service LookUp Service Return Service Instance
  • 24. Demo