semantic versioning of API bundle

一曲冷凌霜 提交于 2019-12-06 07:44:53

Adding an interface to a package is at least a minor change (1.2.3 -> 1.3.0) since you break the provider of the API (which in OSGi is a package), providers of an API have virtually no backward compatibility since they, well, provide the API. After all, any new obligation in the API requires some new code.

Now assume you put an obligation on the consumer to implement this new interface in the API. This change (not visible to the compiler) obviously breaks all existing consumers and will therefore be a breaking change for everybody (e.g. 1.2.3 -> 2.0.0).

To conclude:

  • Micro change -> backward compatible with existing providers and consumers of the API
  • Minor change -> existing providers of the API are not compatible but consumers are
  • Major change -> existing providers and consumers are no longer compatible

The semantic versioning does mention:

Major version X (X.y.z | X > 0) MUST be incremented if any backwards incompatible changes are introduced to the public API.

The addition of the new interface should be considered semantically backward compatible if it does nothing more than calling several old interfaces, now chained into one new operation.
In which case, a minor version increment is enough.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!