Muhammed Senussi
Muhammed Senussi
  • Muhammed Senussi
Are Java Modules Worth It Yet?Java

The module system solved real problems, most of which were the JDK’s own. Whether it solves yours depends on what you ship.

Libraries

A module descriptor is a genuine contract. It says what is public, keeps your internals unreachable rather than merely discouraged, and lets tooling like jlink produce something small. If you publish to other teams, write one.

Applications

An application usually already controls its own boundaries. Modularising one buys strong encapsulation you could have had from a build-level check, and costs you a long tail of reflective libraries that need opens clauses. Measure the benefit before paying that.

2 Comments

  • Daan Visser

    January 15, 2025

    We modularised an application in 2023 and quietly unwound it a year later. Your paragraph on reflective libraries is exactly why.

    • Muhammed Senussi

      Muhammed Senussi

      AuthorJanuary 15, 2025

      That experience is common enough that I think it should be the default expectation, not the cautionary tale. The library case is genuinely different though.

Leave a comment