Please rview simple clean up of the modules build for javac
Alex Buckley
alex.buckley at oracle.com
Mon Apr 5 17:05:53 PDT 2010
On 4/5/2010 3:04 PM, Mandy Chung wrote:
> Jonathan Gibbons wrote:
>> I am surprised to see so many unqualified module names. Do we not
>> expect folk to use qualified module names, and should we not lead the
>> way by prefixing module names with some suitable "j" word?
>
> The names of the jdk modules are yet to be finalized. For the runtime
> modules (i.e. classes from rt.jar), their names are qualified names
> (currently they are prefixed by either "jdk." or "sun."). The modules
> with unqualified module names are the non-runtime modules (such as
> javac, apt, and other jdk tools). Is there a guideline or convention
> for the module names?
It is instructive to browse http://www.jarvana.com/jarvana/browse and
see the names of projects in the central Maven repository. Maven
identifies a module by a triple: groupId, artifactId, version.
Paraphrasing "Maven: The Definitive Guide", the group identifier should
be the reverse domain name of the creating organization (e.g.
org.apache), and the artifact identifier should be the module name. This
convention is not always followed; witness the commons-* groups. Even
when the group identifier is a reverse domain name, it is sometimes
suffixed by a sub-organization or product family, e.g.
org.apache.lucene. Further, in a popular repository, the number of
entries under 'org' or 'com' is so large that the additional top level
provides little benefit. And in 2010, people search rather than
classify; a module name arguably ought to reflect, more than anything
else, the terms used in a search engine to find the module.
Since JDK modules only have name (+version), not group and artifact
(+version), we must structure our names wisely. (Actually, avoiding
group is a blessing, for reasons associated with JCP profiles that I
shall not discuss here.)
Publicly distributed modules like the JDK should always have qualified
names. I do not believe starting a module name with a reverse domain
name is appropriate, because it obscures browsing module repositories
and there are too many projects willing to ignore the convention. Using
the commonly-searched-for product name such as 'jdk' as the first
component seems ideal. Again, in 2010, the existence of large
repositories means that picking a globally unique name is not so hard
that it requires recourse to domain names.
Alex
More information about the jigsaw-dev
mailing list