Versioning interfaces
Robert McQueen
robert.mcqueen at collabora.co.uk
Mon Oct 24 08:39:24 PDT 2005
Something we discussed at the D-Bus BOF at the GNOME summit was
including some kind of optional interface versioning in the
introspection data.
My suggestion was be something like an optional version="x.y" attribute
on <interface>, <signal> and <method> nodes. For the <interface> node,
this is composed of a major version x, which must be incremented when
any signal or method is removed, or arguments/functionality changed, and
the minor version y which must be incremented when a signal or method is
added. On the <signal> and <method> nodes, the attribute merely
documents which interface version the signal or method first appeared
in. Bindings can use these annotations to work out the overall interface
version.
The client side code is then as simple as adding a method which you give
an object, an interface name and the version you're expecting, and it
looks at the introspection data for you and tells you if the provided
version is compatible (your_x == their_x, and their_x >= your_x).
Obviously this is all backwards compatible - a client doing a version
check on a service with no version gets a failure, the addition of
version information to a service when the client does no version check
doesn't break anything.
Comments?
Regards,
Rob
More information about the dbus
mailing list