-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow to distinguish between API and SPI #127
Comments
As far as I understand your concern, the SPI part of the library is concerned about "source compatibility" while the invoked part is concerned by "binary compatibility". Currently you could go by defining two executions (assuming that your SPI and your invoked API reside in two different packages):
This would also generate two different reports. |
I just posted a similar proposal, with some more detail, not realizing that there was this one here already: Please have a look at that one. This is not about source vs. binary compatibility. It is quite different. Source vs. binary is more about generics and what can survive at compile time vs runtime. |
I think the primary difference here is interfaces. If I'm a service consumer (a user of a type exposed as a Java interface), then if a new method is added to that interface, it hasn't broken compatibility. It's a change that should trigger an increment of the minor version number. However, if I'm a service provider (an implementor of a type exposed as a Java interface), then if a new non-default method is added to that interface, it has broken compatibility with my existing code and should therefore trigger an increment of the major version number. The OSGi alliance published a nice short paper on this: https://www.osgi.org/wp-content/uploads/SemanticVersioning.pdf |
@siom79 describes exactly what I'm after. Being able to express this kind of separation would be a big improvement to this - already very useful - tool. |
There are two osgi annotations exactly for this purpose: @org.osgi.annotation.versioning.ProviderType and @org.osgi.annotation.versioning.ConsumerType |
In fact there's even a Maven plugin that will perform similar checks to https://github.com/bndtools/bnd/tree/master/maven/bnd-baseline-maven-plugin |
In libraries one usually has two kinds of contracts:
Different rules apply for the evolution these two categories. E.g. adding method to an interface intended to be invoked by users is perfectly fine. Whereas adding a method intended to be implemented is a breaking change.
Thus I'd like to propose the following:
I know it's are bigger change, but maybe we can get a discussion about it started?
The text was updated successfully, but these errors were encountered: