Closed averbraeck closed 1 year ago
My preference would be option 2, at least in the long term. The name could be djutils-base.
djutils-base < djunits < djutils
The main reason is confusion, e.g. when importing classes, in option 1. To me option 3 ruins how clean djunits is. It has very little to do with almost everything in djutils.
I would add the tinylog functionality in djutils-base so it can be used in djunits.
The disadvantage "the tight integration in the djutils ecosystem" is not very clear to me. Djutils is a bag of useful things, some of which use each other. But I see no logical reason why it has to stay one bag. Two smaller bags, where one (indirectly) depends on the other seems fine to me.
About the 'ecosystem' remark: right now, djutils-base (aka djutils) is a module inside the djutils project, together with the other modules. Versions for all modules are updated at the same time, since all other modules in the djutils project are tightly dependent on the djutils-base project.
One disadvantage of moving djutils-base out is that it becomes a separate project in github, with its own pom file and dependencies to maintain, so it will get its own upgrades, its own new releases, its own registration of the project in Maven Central, etc. All maintenance efforts will have to be done on two projects instead of one. Since it typically takes a few hours to sometimes 1-2 days of work to make a new release that incorporates all kinds of upgrades (where lots of issues have to be resolved), this will now have to be done two times...
But I do agree. It's the only clean option... No code duplication, no useless integration between two independent projects. And we DO need to be able to release djutils-base (or just 'djutils') separately from the rest of djutils and djunits.
The separation of the djutils-base project has been described in issue https://github.com/averbraeck/djutils/issues/24 in the djutils project.
djunits has been made dependent on the separate project djutils-base, breaking the circular dependency. This allows full usage of the classes and data structures in djutils-base (Throw
, Try
, UrlResource
, CategoryLogger
, immutable collections, etc.).
The djunits project was made dependent on djutils, to avoid code duplication for the
Throw
,Try
,URLResource
andNumberParser
classes. Also, the tinylogLogger
andCategoryLogger
can be used by djunits now.On the other hand, djutils is dependent on djunits for the djutils-cli, djutils-data, djutils-eval, and djutils-serialization modules that all use djunits.
The problem is that we now cannot make a new release of djunits that uses the latest version of djutils while releasing the latest version of djutils that is dependent on the latest version of djunits. One of them will always use the one-but-last version...
There are three (and possible more) solutions. @WJSchakel and @OTSim : seeking your input on this.
org.djutils
. When changes in djutils occur, just copy the verbatim code into djunits. This way, djunits also stays 'clean' and is dependent on as few other packages as possible. Advantage: easy, and no overhead taken into djunits. Disadvantage: code duplication and possible inconsistencies between projects.For now, I am thinking about a quick solution using (1) above, but should that also be the long-term solution?