module-info.class spec and attributes

Alex Buckley alex.buckley at oracle.com
Tue Jun 28 16:30:38 PDT 2011


On 6/28/2011 2:24 PM, David Bosschaert wrote:
> I wonder why such a binary .class file for module declarations is
> really needed. Why not go for a textual file, for instance
> META-INF/module-info.jmod (or something like that) and declare the
> module declarations in there using a textual format of some sort?

The arguments for a binary compiled form are given at:

http://openjdk.java.net/projects/jigsaw/doc/draft-java-module-system-requirements-12#_C

> IMO there are multiple benefits associated keeping the textual format.
> People using the jar can use a simple zip tool to look inside the jar
> to see what its dependencies are. Additionally tools can easily be
> written to read the module-info.jmod file without needing to resort to
> classfile parsing libraries. The module information can be of use to
> both developer as well as deployer tools.
> 
> Finally it's probably easier to make the textual file extensible, as
> required by [1], without resorting to inefficient reflection-style
> operations.

I think these points are also captured in Appendix C. Could not the same 
points have been made in favor of a textual format for class and 
interface declarations?

Alex



More information about the jigsaw-dev mailing list