module-info platform dependencies
Jonathan Gibbons
Jonathan.Gibbons at Sun.COM
Fri May 15 09:54:43 PDT 2009
>
>>> I do think that the default should be upon the whole platform.
>>> That's
>>> effectively what it is today. If you want something smaller then
>>> you
>>> can specify it, or maybe use a tool which can analyze your class
>>> dependences, identify the smallest suitable platform module, and
>>> insert that into your module-info source file.
>>
>> The default today is that if I compile something like Hello World, it
>> will run on any version of the platform, even the smallest. (Well,
>> perhaps not JavaCard.)
>
> Ah, I see what you mean. Need to think about this more, but offhand
> it
> still seems like more of a tooling issue, kind of like minimizing
> import
> declarations. Minimization of platform dependences could also be done
> much later, as part of module packaging.
>
> - Mark
Right now, within source code, you only get "java.lang" for free. If you
need to use anything else in the platform, you have to ask for it.
(i.e. import it).
The analogy for modules would be that you get some minimal module by
default (e.g. java.lang, java.io, java.net, java.util) and that if
you want more
(e.g, AWT, Swing, javac-API, etc) you have to ask for it. (i.e.
require it).
Having people declare everything non-basic they need is a good thing,
especially for documentation purposes, and for making it clear to
programmers what the footprint of their app will likely be. And, we
can likely
rely on tooling to help out, just like we do for import management
Or, if people want the whole platform (the module equivalent of import
p.*;)
we can give them a virtual module that includes everything.
-- Jon
More information about the jigsaw-dev
mailing list