No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Java 9 modules - reducing coupling of modules

It's the example of reducing coupling of Java 9 modules. The repo contains four modules

  • pl.tfij.java9modules.greetings.api - module with API.
  • - client consuming the API.
  • pl.tfij.java9modules.greetings.standard - first implementation of API.
  • pl.tfij.java9modules.greetings.conversational - second implementation of API.

To keep code simple, each module contains only one class with a one single-line method.

Included scripts allow to easily run the code. To compile the code just start a script. Then execute the to build jar files. This script provides jar files to three dirs: mod, mods-conversational-greetings, mods-standart-greetings.

For each dir separate runs script is prepared:

  • ./ runs the program with pl.tfij.java9modules.greetings.standard implementation of API at module path and print Hello, World!.
  • ./ runs the program with pl.tfij.java9modules.greetings.conversational implementation of API at module path and print Hi, World!.
  • ./ run the program with both implementations of API at module path. The output is not deterministic, it can be Hello, World! or Hi, World!.