Wednesday, December 19, 2018
Presenter: Andrej Rasevic
Wednesday, December 19, 2018
Desired outcomes:
Wednesday, December 19, 2018
Why was the module system necessary - motivation & background
Improved separation of concerns
how does an application benefit from a modular system?
Wednesday, December 19, 2018
Why was the module system necessary - motivation & background
Increased encapsulation and information hiding
how does an application benefit from a modular system?
Wednesday, December 19, 2018
Why was the module system necessary - motivation & background
Modularity limitations
Wednesday, December 19, 2018
Why was the module system necessary - motivation & background
Limited visibility control
Wednesday, December 19, 2018
Why was the module system necessary - motivation & background
CLASS PATH HELL
Wednesday, December 19, 2018
Why was the module system necessary - motivation & background
Monolithic JDK
JDK is a collection of tools that lets you work with and run java programs
javac - lets you compile Java programs
java along with JDK library allow you to load and run Java program
Wednesday, December 19, 2018
Jigsaw-puzzle style of representation of a Java system
Wednesday, December 19, 2018
module com.foo {
requires com.bar;
exports com.foo;
}In order to become a module, a project must have a module-info.java file at the root of the project's source
Wednesday, December 19, 2018
Modules are very similar to JAR's in that they are container's for types and resources
Modules differ from JAR's by having additional characteristics
Wednesday, December 19, 2018
JDK was broken up into over 100 platform modules
If you want to see them, execute: java --list-modules
Let's run it in the terminal...
Now if we want to inspect a specific module you can run: java --describe-module ${module}
Let's see what the java.sql module API looks like
Wednesday, December 19, 2018
Let's take a look at an example of using Java modules