# Java SE 9 - JPMS module naming

DevFeed: [Java SE 9 - JPMS module naming](<https://devfeed.tech/articles/java-se-9-jpms-module-naming-21995.md>)

Original publisher: [Read original article](<http://blog.joda.org/2017/04/java-se-9-jpms-module-naming.html>)

Author: Stephen Colebourne (noreply@blogger.com)

Published: 2017-04-20T14:01:00Z

Content type: opinion

Language: en

Sources: [Stephen Colebourne](<https://devfeed.tech/sources/stephen-colebourne.md>)

Topics: [modules](<https://devfeed.tech/topics/modules.md>), [Java](<https://devfeed.tech/topics/java.md>), [Software](<https://devfeed.tech/topics/software.md>)

Tags: [best-practices](<https://devfeed.tech/tags/best-practices.md>), [bestpractice](<https://devfeed.tech/tags/bestpractice.md>), [java](<https://devfeed.tech/tags/java.md>), [java9](<https://devfeed.tech/tags/java9.md>), [jvm](<https://devfeed.tech/tags/jvm.md>), [module](<https://devfeed.tech/tags/module.md>), [modules](<https://devfeed.tech/tags/modules.md>), [opinion](<https://devfeed.tech/tags/opinion.md>), [recommendations](<https://devfeed.tech/tags/recommendations.md>)

## AI overview

This opinion article recommends naming Java Platform Module System modules with reverse-DNS names related to their packages, preferably matching the super-package name. It explains namespace ownership and grouping packages into sub-modules without overlap.

## Source excerpt

The Java Platform Module System (JPMS) is soon to arrive, developed as Project Jigsaw. This article follows the introduction and looks at how modules should be named. As with all "best practices", they are ultimately the opinion of the person writing them. I hope however to convince you that my opinion is right ;-). And as a community, we will certainly benefit if everyone follows the same rules, just like we benefited from everyone using reverse-DNS for package names. TL;DR - My best practices These are my recommendations for module naming: 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. Creating a module with a particular name takes ownership of that package name and everything beneath it. As the owner of that namespace, any sub-packages may be grouped into sub-modules as desired so long as no package is in two modules. Thus the following is a well-named module: module org.joda.time { requires org.joda.convert; exports org.joda.time; exports org.joda.time.chrono; exports org.joda.time.format; // not exported: org.joda.time.base; // not exported: org.joda.time.tz; } As can be seen, the module contains a set of packages (exported and hidden), all under one super-package. The module name is the same as the super-package name. The author of the module is asserting control over all names below org.joda.time, and could create a module org.joda.time.18n in the future if desired. To understand why this approach makes sense, and the finer details, read on. JPMS naming Naming anything in software is hard. Unsurprisingly then, agreeing an approach to naming modules has also turned out to be hard. The naming rules allow dots, but prohibit dashes, thus lots of name options are closed off. As a side note, module names in the JVM are more flexible, but we are only cons