concept JPMS in category java

This is an excerpt from Manning's book The Java Module System.
But the JPMS is more than just a Band-Aid. It comes with a number of great features we can use to develop more beautiful, maintainable software. Maybe the biggest benefit is that it brings every individual developer and the community at large face-to-face with the essential concept of modularity. More knowledgeable developers, more modular libraries, better tool support—we can expect these and more from a Java world where modularity is a first-class citizen.
Figure 8.6 With the plain JARs
monitor.jar
,monitor.observer.jar
, andmonitor.statistics.jar
on the module path, the JPMS creates three automatic modules for them. The class-path content ends up in the unnamed module as before. Note how automatic modules read each other and the unnamed module, creating lots of cycles in the graph.![]()
The JPMS is in a different position. First, its reduced feature set (particularly, no version support, and dependencies on modules, not packages) makes it less complex. In addition, it benefits from being built into the JDK. All Java developers are exposed to the JPMS to some degree, and more senior developers in particular will explore how it can help them with their projects. This more intense use will also spur good tool integration.
So if a team already has the skills and tools and is already running on top of the JPMS, why not go all the way and modularize the entire application? This step builds on existing knowledge, incurs less additional complexity, and requires no new tools, while giving a lot of benefits.
In the end, even OSGi stands to profit from the JPMS, because Java 9+ will put modularity on the map much as Java 8 did with functional programming. Both releases are exposing mainstream Java developers to new ideas and are teaching them an entirely new skill set. At some point, when a project stands to benefit from functional programming or more powerful modularity, its developers climb enough of the learning curve to evaluate and maybe use “the real thing.”