dots or underscores in package names - was: Re: Jigsaw @ JavaOne 2015

Peter Levart peter.levart at
Sat Oct 31 18:58:15 UTC 2015

Like with package names, module names must be globally unique to prevent 
name clashes. What that means is module names must be hierarchically 
structured so that different parts of a name can be assigned by 
different parties (for example: prefix is taken from domain name, ...). 
I haven't seen a syntax using underscores for expressing hierarchy in 
names yet. Using underscores as hierarchy delimiters would also be 
inconsistent with other Java names, because components of module name 
could not use Java identifier syntax then which includes underscores. I 
think it is important to make a distinction between a convention and a 
prescribed syntax of a hierarchical name.

Regards, Peter

On 10/29/2015 12:03 AM, Paul Benedict wrote:
> Tim, but Maven doesn't have a native concept of packages. That's a compiler
> concern, and now Java's compiler will have both package names and module
> names both with dots? I think that is confusing. A package is a properly
> nested naming structure... but a module is just a simple name. Correct me
> if wrong, but modules can't bundle nested modules, right? If it can't, then
> using dots is more problematic than it's worth. That's why I recommend it
> follow the standard Java identifier rules where underscores are the
> preferred separator.
> On Oct 28, 2015 2:43 PM, "Tim Boudreau" <niftiness at> wrote:
>> +1 - people have been using . as a delimiter for maven groupId and
>> artifactId names for years, and I've never heard of someone's head
>> exploding as a result.
>> Similarly, NetBeans module system has used . as a delimiter since 2000, and
>> I don't recall ever seeing a message on the mailing lists (which I've been
>> on since '99 and am still active on) having a problem with it.
>> -Tim
>> On Wed, Oct 28, 2015 at 12:59 PM, David M. Lloyd <david.lloyd at>
>> wrote:
>>> We've been (with JBoss Modules and thus our various application server
>>> offerings) using module name conventions that match package names for
>>> several years, and the number of people who have actually been confused
>> by
>>> it to my knowledge is exactly zero.
>>> The actual problem is probably quite overstated.  People just don't seem
>>> to have trouble with this (nor do people generally seem to get confused
>> by,
>>> for example, a C++ library name being the same as the root C++ namespace
>>> used by that library, to draw another language equivalent).
>>> On 10/28/2015 06:56 AM, Remi Forax wrote:
>>>> Hi Marrio,
>>>> When creating a new application, using the prefix of the packages as
>> name
>>>> for a module seems intuitive and using '_' instead of '.' as separator
>>>> inside the module name avoid the unecessary confusion for a human
>> between a
>>>> package and a module with the same name, it's just a code convention.
>>>> When retrofitting an old application, like by example the JDK, you will
>>>> group packages that have no a common prefix name or the common prefix
>> can
>>>> be used for several modules, in that case, having a module named
>> java.base
>>>> but no package java.base.something seems counter intuitive, using '_'
>>>> instead of '.' make clear that a module name is just a name.
>>>> regards,
>>>> Rémi
>>>> ----- Mail original -----
>>>>> De: "Mario Torre" <neugens.limasoftware at>
>>>>> À: "Paul Benedict" <pbenedict at>
>>>>> Cc: jigsaw-dev at
>>>>> Envoyé: Mardi 27 Octobre 2015 23:41:05
>>>>> Objet: Re: Jigsaw @ JavaOne 2015
>>>>> 2015-10-27 22:13 GMT+01:00 Paul Benedict <pbenedict at>:
>>>>>> Thanks Mark. Great slides. I'd just like to throw out my impression
>>>>>> (again)
>>>>>> that module names with dots look like packages. How receptive is the
>> EG
>>>>>> to
>>>>>> changing it to underscores?
>>>>> I think that this is the exact point, mapping to package seems quite
>>>>> intuitive as it represents directly the content of the module.
>>>>> Cheers,
>>>>> Mario
>>>>> --
>>>>> pgp key: PGP Key ID: 80F240CF
>>>>> Fingerprint: BA39 9666 94EC 8B73 27FA  FC7C 4086 63E3 80F2 40CF
>>>>> Java Champion - Blog: - Twitter: @neugens
>>>>> Proud GNU Classpath developer:
>>>>> OpenJDK:
>>>>> Please, support open standards:
>>> --
>>> - DML
>> --

More information about the jigsaw-dev mailing list