sormuras / modules

🧩 Java modules published at Maven Central

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Top-level domain dropped from the beginning of module name

sormuras opened this issue · comments

After scrolling a bit in suspicious/naming.md, it seems fairly common to leave out the top-level domain from the beginning of your module name.
Maybe this case needs consideration? 🤔

Originally posted by @Michael1993 in #11 (comment)

As far as I know, if you upload an artifact (e.g.: org.foo.bar:bartifact:1.0.0) to maven central it is a prerequisite that you own the domain foo.org.
I'm mentioning this because this should be a safeguard from impostor modules?

My best guess right now would be a "first-come-first-serve" model. If there is no competition for a particular module name, (e.g.: there is no org.foo.bar and com.foo.bar, only net.foo.bar) then is there a reason not to be optimistic about them and "let them in"?

I like module names best when they start with a TLD.

Common (well-known) exceptions to that rule are already covered by maven-group-alias.properties

Extending this hand-crafted mapping is a good enough solution for the time being.

„I like module names best when they start with a TLD…“

That seems capriciously restrictive. The majority of the JDK's module names don't even meet your criteria…

  • Module names must be reverse-DNS, just like package names, e.g. org.joda.time.
  • Modules are a group of packages. As such, the module name must be related to the package names.
  • Module names are strongly recommended to be the same as the name of the super-package.

That seems capriciously restrictive.

No.

The majority of the JDK's module names don't even meet your criteria…

Yes. And...?

Feel free to upvote sonatype-nexus-community/search-maven-org#6 and https://youtrack.jetbrains.com/issue/PKGS-451 -- would be nice to have those indexes updated in 2020. All kind of module names (even invalid ones) are allowed there.

This project will stick with strict(er) naming conventions.

The majority of the JDK's module names don't even meet your criteria…

Yes. And...?

And…given a choice between the advice from a rando on github and that of the stewards of the language…

- Module names should use the reverse-domain-name-prefix convention
or, preferably, the project-name-prefix convention.

…
The reversed domain-name approach was sensible in the early days of Java,
before we had development tools sophisticated enough to help us deal with
the occasional conflict. We have such tools now, so going forward the
superior readability of short module and package names that start with
project or product names is preferable to the onerous verbosity of those
that start with reversed domain names
.

…I'll stick with the language steward's preference instead of your personal preference.

And…your personal preference means nothing to the majority of the project maintainers who will give up in frustration after trying to decipher the meaning of the data in your inadequately labeled lists.