module name convention
Nicolai Parlog
nipa at codefx.org
Wed Oct 14 19:18:44 UTC 2015
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256
Hi!
After playing around with Jigsaw for a while I agree with Mani's
original remark - modules should not also use '.' by convention.
Case in point: The quickstart guide uses '.' as a separator in
package, module and folder names. And while everything is ok as long
as you work through it step by step, it is really hard to quickly look
something up because everything looks the same. This is worsened by
the fact that all three names are identical for simple examples.
I have been using '_' instead but would've preferred '-'. I think the
latter looks better and is much more in line with how we typically
name the other abstraction on the same level: JARs.
But I agree that special casing might be overkill.
so long ... Nicolai
On 14.10.2015 20:46, forax at univ-mlv.fr wrote:
> 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-Md3Fn5h4sXHa75RA
pWNLszUTVp-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
>>
>>>>
>>
>
- --
PGP Key:
http://keys.gnupg.net/pks/lookup?op=vindex&search=0xCA3BAD2E9CCCD509
Web:
http://codefx.org
a blog about software development
http://do-foss.de
Free and Open Source Software for the City of Dortmund
Twitter:
https://twitter.com/nipafx
Diaspora:
nipa at pod.geraspora.de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAEBCAAGBQJWHqqSAAoJEMo7rS6czNUJjQMQAIA2JHxO16Rs4I+0MfNL71tk
1wJRDyhOIZXG8C7dxwv42P68yexk+szZBbeUJT+hytc36v+b3lFPK9NxNCusjTQc
kMgIjQtLIPPB5I2YQEooX8D6QsoNCP1Y4IE4rzSSziyZOY7LNXIFvqC5EBh75VE9
PDCzW3hGjnExu8QfEip2ysQrrXG2PDV2BT6vWo9UnHHzxEfsABDm3MvMStsM7J0R
tIdYMDZnXXjXIVTmDWN0XRJpLximEwGhkcseKZZt44oY2mwVgYCASWJQmNrGq3GI
pQv2cEeqml808kKC8uYv0hip8ha6CWcEQ6le3VKNkObCKfbogAytnc8HSOUS4kBo
0mIIDJRdI1r1f7IAfx3uJlzkhCbU7ag4LiP1t+qKoy5Dk5ac9IXWuGFF8eJyJVX1
vhuTvU9tACgnfnzIRr2x9baB2CxgXsEnSpZrIMW9QOgN5BqFO/wAqC1WXG1/RmpU
5hyJkbUlWb3RiDyBS4xZAJ3YxL3v5xAQ/Go7e1B2SmsXisOAQKg73el7hsxAsJLq
AN5FpHUFzWHtIT3rfyh6EcFPH3/YgVVp9ygE1t6Pk8bEm55AClnJ/2sfQl05PNXo
+lRX3qshD/aoCaz00MKIu+onq2TQ2qEEhDpzwG0EMUmnMjX1T8IEX/k5373IZgPR
0XI0G86JMdARL75XSTVj
=xIPL
-----END PGP SIGNATURE-----
More information about the jpms-spec-observers
mailing list