JPMS module names, super-package, and package renaming #693
Replies: 4 comments 3 replies
-
It looks like the bold face markup didn't show up in your post, but I think I have a pretty ok idea on where the idea of one superpackage per module works. What would really be helpful is multi module jars. I think it was hinted at in Stephen Colebourne's blogpost Java SE 9 - JPMS module naming, as he has an example of it about half-way down the page, but it looks like it was deferred to a future release. But for now, one module per jar artifact, and I think that's why it's so dang tempting to try to use a convention to name the module based on the artifact (which is also argued against in the same blog post). That said, I think we at least have to look at things from the point of view of one module per artifact since that is a hard limitation at the moment, which means one superpackage per artifact (e.g. gradle subproject), which is what you pretty much did above (talking to myself outloud a bit here).
I think that's right. The public API is contained completely in Package-wise, the public API in version 6 looks like this:
and these are all currently contained within the
(
For those following along, see Page 7 of the hymnal. I agree that it does not seem viable to maintain both old and new packages in the same release if the packages are moved, BUT I think we could use some gradle magic to effectively do that while only maintaining the new packages. This would require:
Thoughts? In terms of naming, as you mention, long term maintenance and ownership is important. Unidata is committed to being stewards of the codebase for as far as we can see into the future, but I like to think of ownership as more of a community based thing. If Unidata were to disappear (no signals to think we will, but you never know the future of NSF funded endeavors), I have no idea what would happen internally at UCAR. Would another UCAR group pick up the stewardship of the library? I don't believe so. In that scenario, my best guess is the library would get forked and maintained as a non-organization backed library (or, at least, that's what I would try to do if no other group at UCAR jumped at the chance to fund maintenance of or value add to (like hosting docs, mailing lists, support, etc.) the project. All of that said, I'd add the following two options to the list as the superpackage, and thus potential module name, to use in
Packages in other gradle subprojects, like |
Beta Was this translation helpful? Give feedback.
-
Hi @JohnLCaron & @lesserwhirls - Sorry if I stumble over some of this. I'm a bit fuzzy on the constraints surrounding it all. Both of you include some reverse-DNS looking names as an option for something (I think for module names and for possible renaming of packages that are not part of the public API). Only one of the options listed is an actual reverse-DNS name this project has any control over (John's edu.ucar.unidata.cdm suggestion). Is there a reason not to start ensuring all appropriate module/package names, where possible, start with "edu.ucar." or "edu.ucar.unidata."? |
Beta Was this translation helpful? Give feedback.
-
cdm is way too common, and cdm.org is taken. netcdfjava.org? the domain name is available... |
Beta Was this translation helpful? Give feedback.
-
Hi, I would like to revive this discussion. @uhoefel and me are trying to get the Nujan pure Java HDF5/NetCDF writer modernized, i.e., compliant with JPMS. Here, we require cdm-core to also be a Java module. Are there any plans/news/ways to contribute for this? |
Beta Was this translation helpful? Give feedback.
-
It would be ideal to have JPMS module names follow the "super-package" naming convention, meaning that all code in the module lives under a single package, and no other module has code in that package or subpackage.
But we have legacy code where thats not true. In the list below,
array
ucar.array
bufr*
ucar.nc2.iosp.bufr
cdm-core
thredds.client
thredds.featurecollection
thredds.filesystem
thredds.inventory
ucar.nc2
ucar.unidata.geoloc
ucar.unidata.io
ucar.unidata.util
cdm-s3*
thredds.filesystem
thredds.inventory
ucar.unidata.io.s3
gcdm*
ucar.gcdm
grib*
ucar.nc2.grib
jj2000*
ucar.jpeg
netcdf4*
ucar.nc2.ffi
ucar.nc2.jni
opendap*
opendap
ucar.nc2.dods
uibase*
ucar.ui
ucar.util
uicdm*
thredds.logs
thredds.ui
ucar.nc2.ui
ucar.nc2.util
udunits*
ucar.units
If you believe the asterisks, then the problem is mostly in the cdm-core module.
The ability to rename is mostly tied up with backwards compatibility. It doesnt seem viable to have both old and new packages in the same release(?) see Make breaking transitions easy
The choice of names is tied into long term maintenance and ownership. Some options suggested are:
Beta Was this translation helpful? Give feedback.
All reactions