2

I am using semantic versioning 2.0.0. In my situation I have a concrete implementation of some interface A in one library. And I have the interface that's being implemented (call it B) in another library.

I understand that if I were to add new methods to the interface B then that would be considered a major change for B because any library that implements the interface (such as A) would not compile until implementing whatever methods were added. My reasoning for this being considered a major change is because you've now made an incompatible API change to B (according to semantic versioning). I think that I understand this concept clearly but correct me if I'm wrong.

Here is my question, and the part that I don't understand... What happens to A, the concrete that's actually implementing the interface? Does he get a major or minor revision number change? I guess that from one stand point you could say he gets a minor revision change because adding a public method doesn't make him incompatible like for instance... if you were to change the name of a method... I guess you could also argue that he would get a major change because he needs to implement the interface in order to work. Is either one of these reasonings correct, or neither?

  • Sorry if it looks cross-posted, I deleted this from StackOverflow but it may still show up!!! Hopefully it goes away soon! (I accidentally posted over at SO first) – Snoop Feb 3 '17 at 14:04
1

OK. so

you have

public class A : IA {}

and

public interface IA {}

in different libraries

And I have

public class MyA : A {}

for which i am consuming your IA.dll

If you add a method IA.GetAs(), then yes its a major change because A will not compile until you add an implementation of the interface.

It seems like MyA will still compile when I update to both A.dll v2 and IA.dll v2

However, What if I already have MyA.GetAs()? Its possible that my code would end up calling A.GetAs() instead of MyA.GetAs(). So i think you would have to upgrade the major version number.

In general I would consider any change to the exposed methods/properties etc of an object to be a major change.

  • This is how I was thinking about it, only now does MyA get a MAJOR or MINOR update? I guess it may not get any update at all if it's borrowing implementation from some concrete class. – Snoop Feb 3 '17 at 15:46
  • well MyA would now also expose the new method, so it should also get a major update. Although obviously I might not expose MyA at all in my library, using it only internally. – Ewan Feb 3 '17 at 15:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.