Class ModuleSystemNotes

java.lang.Object
net.jrodolfo.java_evolution.java09.ModuleSystemNotes

public class ModuleSystemNotes extends Object
Explains the Java Platform Module System (JPMS), introduced in Java 9.

Before Java 9, Java applications were primarily organized with the classpath. The classpath could not express strong module boundaries, so code could accidentally depend on internals and the JDK itself was difficult to divide into smaller, well-defined pieces.

The module system solves this with explicit module descriptors. A real modular application normally contains a module-info.java file at the root of a source set. This Spring Boot reference project intentionally does not become a modular application yet, because the goal is to keep each feature example small and independent.

  • Constructor Details

    • ModuleSystemNotes

      public ModuleSystemNotes()
  • Method Details

    • minimalModuleDeclaration

      public String minimalModuleDeclaration()
      Shows the shape of a minimal module declaration.
      Returns:
      a compact module-info.java example
    • requiresDirective

      public String requiresDirective()
      Explains the requires directive.
      Returns:
      a short explanation of requires
    • exportsDirective

      public String exportsDirective()
      Explains the exports directive.
      Returns:
      a short explanation of exports
    • projectDecision

      public String projectDecision()
      Explains why this project is not modularized at this stage.
      Returns:
      the project decision about modules