2 ms·
Not really: using modules is completely optional. Small applications likely won't benefit from the structure and guarantees modules offer. Large-scale applicati
by SanderMak 9y ago
Not really: using modules is completely optional. Small applications likely won't benefit from the structure and guarantees modules offer. Large-scale applications, however, will certainly benefit from strong encapsulation and explicit dependencies all enforced from compile-time through run-time (and adding an optional linking step for modules with jlink).
(full disclosure: I'm author of Java 9 Modularity, O'Reilly, see https://javamodularity.com https://javamodularity.com)
- bitL 9y agoHow does it relate to OSGi? Also, if just one library uses modules, does it force modularization of everything else or can these two coexist in a reliable fashion?
- SanderMak 9y agoGreat questions. - OSGi: offers run-time modularization (based on classloaders), with a more dynamic model (bundles can start/stop/load/unload). Often derided for its complexity, which Jigsaw has tried to reduce (in part by offering a less dynamic model) - Forced modularization: fortunately, Java 9 has many migration features to allow incremental modularization. Most notable are automatic modules, which allow you to treat non-modularized JARs as modules, and interoperation between automatic modules and the classpath Hope this helps.