--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Who is supposed to implement the interfaces?
Part of the Semantic Versioning mechanics concern whether an API is implemented by providers of the technology or by consumers of the technology. This distinction governs how the version of this API is updated given a change to the Interface.
Let’s take EventAdmin as an example. If you want to use that API to send an event, you consume the EventAdmin service and invoke a method on it. That is actually a pretty common use case. If we add a new method to EventAdmin, this would be a minor change, backward compatible with existing users as this is an interface that is “provided”, so adding a method does not change anything for them. However, when you want to listen to events, you need to implement EventHandler and register it as a service in the service registry. When we would add a method to EventHandler, it would suddenly not be a backward compatible change as in Java (prior to Java 8 and its default implementations) you must implement all methods of an interface. In other words, existing users now “consume” the interface, and adding a method breaks their implementations. So, when designing an API, we must somehow express that an interface is either a “provider” or “consumer” type. For this, Bndtools added two annotations: @ProviderType and @ConsumerType. When you annotate your interfaces like this, semantic versioning will take this into account and will correctly bump either the minor or major version when you add a method to a type.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--BJ--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
On Jun 21, 2017, at 3:59 PM, Peter Kriens <pkr...@gmail.com> wrote:
Therefore, to decide if a class is a provider or a consumer of an API think of future scenarios.
Semantic version is about promising how you will signal breaking backwards compatibility. Your future releases will break people that consume your product and, in the case of APIs, your or people that provide an alternative.
On 21 Jun 2017, at 10:01, David Leangen <david....@gmail.com> wrote:Thanks, Peter. There are a few nuances that I am still not quite grasping, but I’ll stick to my main issue only here.
On Jun 21, 2017, at 3:59 PM, Peter Kriens <pkr...@gmail.com> wrote:Therefore, to decide if a class is a provider or a consumer of an API think of future scenarios.If a class is a provider or consumer of an API, to me that is not too difficult to understand. I also understand why the consumer and the provider would be affected differently by different types of changes to the API.So, maybe I am misunderstanding somewhere else. I’ll try to use a contrived example.Say I have an package: com.example.api (1.0.0), which has two interfaces:
interface Foointerface BarNow say I have a provider package (com.example.provider) and a consumer package (com.example.consumer).My understanding of the @ProviderType and @ConsumerType annotations is that they would appear on Foo and (or???) Bar, so:@{Provider|Consumer}Type interface Foo@{Provider|Consumer}Type interface BarI can identify who the consumers and providers of the API are. That’s easy enough: com.example.provider is the provider and com.example.consumer is the consumer. But since the API has both consumers and providers, how the heck do I determine if Foo and (or???) Bar should be annotated as @ConsumerType or @ProviderType?
Is it related to this?Semantic version is about promising how you will signal breaking backwards compatibility. Your future releases will break people that consume your product and, in the case of APIs, your or people that provide an alternative.
Or are these annotations supposed to be used in a completely different way?
Cheers,=David
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.
--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "bndtools-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-users+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to bndtools-user...@googlegroups.com.