Jigsaw Quick Start guide
Alex Buckley
alex.buckley at oracle.com
Tue Jun 28 11:10:27 PDT 2011
I recall discussion of different entrypoints when a module is used in
different contexts, e.g. applet v. command-line launcher.
However, the Java Module System requirements don't say anything about
this, so I stuck with a solitary, unqualified 'class ...' construct in
the module declaration. The closest "context-aware" requirement is that
a module "can be used both as a JAR on the class path and installed as a
module in a module library".
Alex
On 6/28/2011 10:41 AM, Roger Riggs wrote:
> Hi,
>
> Thanks for the writeup of jigsaw modules.
>
> This is more of a comment on the module compilation unit grammar
> and the choice of keywords and semantics.
> http://openjdk.java.net/projects/jigsaw/doc/topics/grammar.html
>
> The "class" keyword in the module-info.java sticks out as an awkward usage.
> There are plenty of classes in the module. The significance the class
> is that it is a/the main class. The keyword should identify the usage
> of the class.
> "main" would be more meaningful and intuitive.
>
> The "class" keyword is being overloaded. While it identifies a main
> class it is
> also being used to indicate module is the root of the static context for
> the module as a whole and the class name is not relevant to that function.
>
> A separate keyword defining the module as requiring a static context
> would clearer to separate the semantics of the entry point from the
> "classloader"
> behavior.
>
> Can a module, like a jar file could contain multiple classes with main
> methods?
> In current usage, for jar files, the main class can be given on the
> command line
> allowing multiple applications to share the overhead of packaging.
> Having a solitary entry point may result in extra overhead because each
> application
> must be in a separate module.
>
> Roger
More information about the jigsaw-dev
mailing list