3 Defining modules and their properties

 

This chapter covers:

  • what a module is and how module declarations define them
  • discerning different types of modules
  • readability, which connects modules
  • accessibility, which encapsulates a module’s internals
  • the module path and its meaning for the module system
  • module resolution and the module graph

We’ve been talking about modules a lot by now and you’ve just gotten a first look at them in chapter 2. They are the core building blocks, not only of modular applications, but also of a true comprehension of the module system. As such, it is important to build a deeper understanding for what exactly they are and how their properties shape a program’s behavior.

3.1  Modules—the building blocks of modular applications

3.1.1  Java modules (JMODs)—shipped with the JDK

3.1.2  Modular JARs—home-grown modules

3.1.3  Module declarations—defining a module’s properties

3.1.4  The many types of modules

3.2  Readability—connecting the pieces

3.2.1  Achieving reliable configuration

3.2.2  Experimenting with unreliable configurations

3.3  Accessibility—defining public APIs

3.3.1  Achieving strong encapsulation

3.3.2  Encapsulating transitive dependencies

3.3.3  Encapsulation skirmishes

3.4  The module path—letting Java know about modules

3.4.3  Adding modules to the graph

sitemap