Versioning interfaces
Robert McQueen
robert.mcqueen at collabora.co.uk
Mon Nov 14 12:19:16 PST 2005
Tako Schotanus wrote:
> Just imagine an old interface with an extra count of "1" and a newer
> interface with one new method (without arguments) where they left out
> the "extra" count. They would suddenly be the same.
This is a red herring, you can engineer exactly the same breakage with
manual major/minor version annotation. If you lower a number, you break
it. :)
> Wouldn't having both systems work?
> Use the automated method/argument count always, because it will at least
> detect interfaces that really are not compatible and an optional
> major.minor version number in the annotations.
Having both seems like complete nonsense: see below. Interface names
behave like major version numbers, and the minor version number is what
we are talking about with the automatic counting.
> That will give you the ability to ask for a specific version of the
> interface while safeguarding against lazy or forgetfull programmers. And
> at the same time it makes versioning easier because asking for version
> 2.1 is easier than having to look up somewhere what the "count" is for
> that new interface that you need.
Lazy and forgetful programmers can always break any system, be it manual
or automatic. We have to assume someone implementing an interface is
doing so to provide a service to a client, not an IPC assault course.
> BTW, what was the reason again for flagging interfaces that have new
> methods as incompatible with older versions? Is that because we can't
> make that work in all language bindings? I know there was a good reason
> but I can't seem to remember :-)
No, if we implemented only a single number, it would be a like the minor
number. We can interoperate with the service if it's version is greater
than or equal to the one we're expecting.
The major part would be done by implementing a new interface. If you
consider it, major version numbers on an interface just behave like part
of the name anyway, but it's just becomes a way to fool a client that
you can service it until it does a version check, or a way to break the
client if it doesn't. I tend to agree with the "suggest a convention for
renaming the interface
I'm quite happy with the concept of using a count of signals/methods
plus a delta to work this out. The only question is where we implement
it... in the bindings where they parse the introspection data? The delta
can become an annotation on the interface.
> Cheers,
> -Tako
Regards,
Rob
More information about the dbus
mailing list