concept module boundary in category java

This is an excerpt from Manning's book The Java Module System.
It can, of course, be argued that security-relevant code should be double, triple, or quadruple checked. But to err is human, and requiring us to manually insert security checks at module boundaries poses a higher risk than a well-automated variant.
Figure 2.3 The ServiceMonitor application’s modules (bold) overlaying the class structure (regular). Note how class dependencies across module boundaries determine module dependencies.
![]()
Section 3.3 extensively covers how the module system’s accessibility rules provide strong encapsulation across module boundaries. It only discusses types, though, and at runtime you usually need to access resources, too. Whether those are configurations, translations, media files, or in some instances even raw
.class
files, it’s common for code to load these from JARs that ship with the project. Because the JPMS turns modular JARs into modules, which claim to strongly encapsulate their internals, we need to explore how that affects resource loading. Before we go into that, in the following sections I’ll give a short recap of how resources were loaded in the past and point out the changes Java 9+ incurs. We’ll then take a closer look at loading package resources across module boundaries.