-
Notifications
You must be signed in to change notification settings - Fork 44
Description
Adding support for the SPDX 3.1 release will require an update to spdx-model-to-java code generator to support multiple dot releases of the spec.
The simplest approach would be to just add another package specific to the dot release (e.g. org.spdx.library.model.v3_1).
This, however, will require all applications that access the model through Java update their imports to the new version - including the utilities in this library.
Since dot releases are backwards compatible, we could create a package which is always the "latest" - this is similar to how we treat the SPDX 2 spec versions.
I can think of a few specific alternatives:
- Just produce the latest version and drop support for earlier dot releases
- Produce one package per dot release
- Produce one package per dot release plus a "latest" package (e.g.
org.spdx.library.model.v3_latest) - Use interfaces rather than class hierarchies and use multiple interfaces and an interface hierarchy to create a common interface that would work across all versions
In looking into 4, I ran into problems with the enums since you can not extend the enum classes and there is no straightforward way that I could find to support a compatible enum class that allows extensions for later dot releases (e.g. adding additional relationship types). 4 is also the most complex and involved solution.
Implementing 3 would be straightforward and I believe will support most use cases.
2 has the issue of requiring code updates on every release to change the imports.
1 doesn't support validating previous versions.