Do we actually need module names?
mark.reinhold at oracle.com
mark.reinhold at oracle.com
Thu Dec 10 01:23:45 UTC 2015
2015/10/12 9:48 -0700, peter.kriens at aqute.biz:
> If a module could require package names instead of module names it
> would not be necessary to introduce a new orthogonal namespace to the
> code base.
>
> If we take an application module path then this will represent a
> limited (max a few thousand, on average much less) set of modules. The
> current design already implies that in this set modules their exported
> packages must be unique,
No, there's nothing to prevent artifacts on a module path from defining
modules with conflicting packages. What's forbidden is to have two
modules with conflicting exported packages related by readability in
the module graph, after dependences are resolved.
> so there is no need to resolve multiple
> versions. It is therefore very almost no overhead to find a module by
> its exported packages instead of a module name.
>
> Since the Java bytecode already contains the reference to the exported
> packages it is straightforward to translate these references to a
> require package in the module definition. This will actually be much
> less work than developers maintaining a module namespace.
Developers already maintain what amounts to a module namespace, in
pom.xml or its equivalents, they just call it something else.
Or, as Bob Martin might say, the unit of reuse is the unit of release
[1], so to assemble a large system from such units it's most natural
to refer to the units themselves rather than to things inside them.
- Mark
[1] http://www.butunclebob.com/ArticleS.UncleBob.PrinciplesOfOod
More information about the jpms-spec-observers
mailing list