module name convention

forax at univ-mlv.fr forax at univ-mlv.fr
Wed Oct 14 18:46:16 UTC 2015


You can always make '-' contextual i.e. consider '-' as a valid character for an identifier by changing the rule of the lexer when the parser as seen the keyword 'module', 
but creating a special case for that doesn't worth the pain to update the specification and will not play well with everything that try to parse a Java identifier like by example Character.isJavaIdentifier[Start|Part]. 

cheers, 
Rémi 

----- Mail original -----

> De: "Paul Benedict" <pbenedict at apache.org>
> À: forax at univ-mlv.fr
> Cc: "mark reinhold" <mark.reinhold at oracle.com>,
> jpms-spec-observers at openjdk.java.net
> Envoyé: Mercredi 14 Octobre 2015 15:58:08
> Objet: Re: module name convention

> Definitely a -1 on dots in the module name. Underscores are better, but I
> prefer dashes to align with general Maven conventions.

> PS: Are there any rules that the module name must be a valid Java identifier?
> If so, then underscores would fit the bill; dashes would not.

> Cheers,
> Paul

> On Wed, Oct 14, 2015 at 8:53 AM, < forax at univ-mlv.fr > wrote:

> > Just a quick note,
> 
> > I've presented the Java module spec in its current state at JTRES (a
> > realtime
> > Java conf).
> 

> > I've used the '_' notation which clearly make the things more readable,
> 
> > I had no question related to the fact that people were troubled because
> > 'requires' takes a module and 'exports' takes a package.
> 

> > Rémi
> 

> > ----- Mail original -----
> 
> > > De: "mark reinhold" < mark.reinhold at oracle.com >
> 
> > > À: "Remi Forax" < forax at univ-mlv.fr >
> 
> > > Cc: jpms-spec-experts at openjdk.java.net
> 
> > > Envoyé: Lundi 5 Octobre 2015 20:48:23
> 
> > > Objet: Re: module name convention
> 
> > >
> 
> > > 2015/9/19 10:02 -0700, forax at univ-mlv.fr :
> 
> > > > Mani from AdoptAJSR has a very good question at the end of this
> > > > document:
> 
> > > > https://docs.google.com/document/d/1KlumN74IGt-TU-Md3Fn5h4sXHa75RApWNLszUTVp-DE/edit
> 
> > > >
> 
> > > > ...
> 
> > > >
> 
> > > > Both Eclipse and Maven use package name or at least package prefix as
> 
> > > > convention to name module and as Mani said it really confusing when you
> 
> > > > write a module-info file.
> 
> > > >
> 
> > > > Given that the name of the JDK modules doesn't respect that convention
> 
> > > > but still use '.' to separate the different components, I wonder if we
> 
> > > > should not try to come with a convention for module name that allow to
> 
> > > > easily disambiguate between package name and module name.
> 
> > >
> 
> > > Yes, I think that's worth exploring.
> 
> > >
> 
> > > > By example,
> 
> > > > java_base,
> 
> > > > java-base,
> 
> > > > java~base ...
> 
> > >
> 
> > > Quick reactions:
> 
> > >
> 
> > > java_base is still a Java identifier, which is nice.
> 
> > >
> 
> > > java-base corresponds usefully to how JAR files are typically named
> 
> > > (e.g., java-base-1.2.3.jar).
> 
> > >
> 
> > > java~base is pretty ugly (especially with longer names, e.g.,
> 
> > > jdk~scripting~nashorn~shell).
> 
> > >
> 
> > > I'm sure there are other possibilities ...
> 
> > >
> 
> > > > Obviously the other solution is to prefix a name by "package" or
> 
> > > > "module".
> 
> > >
> 
> > > As in, `requires module com.foo` and `exports package com.foo`?
> 
> > >
> 
> > > - Mark
> 
> > >
> 


More information about the jpms-spec-observers mailing list