Lack of "export dynamic" requires to export everything for existing frameworks
Paul Bakker
paul.bakker at luminis.eu
Mon Oct 3 09:23:28 UTC 2016
I have updated the migration demo that Sander and I showed at JavaOne to
the latest Jigsaw prototype (
https://github.com/sandermak/java9-migration-demos). This is a
Spring/Hibernate application. The goal is to migrate the app's code to a
named module, while keeping libraries as automatic modules or on the
classpath.
Compared to the previous prototype I find the result less satisfactory.
Both Spring and Hibernate use reflection on implementation types, which now
require either the use of weak modules or "export private" for
implementation packages.
The result is that pretty much all implementation packages are not
encapsulated any more, which isn't very good.
In the previous prototype "export dynamic" was a nice workaround. While
this is not really encapsulation, it at least prevents developers to create
compile time dependencies.
Without dynamic exports (or something similar in concept) I'm afraid most
applications using existing frameworks are never going to get beyond weak
modules or simply exporting everything.
Paul
More information about the jigsaw-dev
mailing list