Jigsaw Quick Start guide
Roger Riggs
Roger.Riggs at oracle.com
Tue Jun 28 10:41:42 PDT 2011
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
On 06/27/2011 09:25 PM, Mandy Chung wrote:
> I put together a document to give a quick demo on how to create a
> module:
> http://openjdk.java.net/projects/jigsaw/doc/quickstart.html
>
> It's just a simple example and the content will grow over time. It
> will be updated for the various works we're working on such as
> exports, exploded module, and the signed module work when we get them in.
>
> Mandy
More information about the jigsaw-dev
mailing list