Versioning interfaces

Havoc Pennington hp at redhat.com
Mon Oct 24 16:26:57 PDT 2005


Hi,

On Mon, 2005-10-24 at 16:39 +0100, Robert McQueen wrote:
> Something we discussed at the D-Bus BOF at the GNOME summit was
> including some kind of optional interface versioning in the
> introspection data.
> 

Historically my thought on that has been to just use the COM rule (if
you change an interface you rename it). I think the COM rule is probably
right for *breaking* an interface at least... for adding more methods to
an interface, maybe the versioning is a better approach but here's an
idea I just had: rather than an explicit version, the "version" is just
a count of the number of methods and signals the interface has. So if
you add stuff, the version automatically goes up. It can't go down,
since to break an interface you have to rename it. If you want to be
sure you have all the methods you expect, you just require that the
interface member count is at least what it is today.

So the explanation for interface providers is very simple:
"Remove or change a method -> rename your interface"
"Add method or signal -> no special action on your part"

This way there's no version metadata to be kept in sync or manually
updated, which might make the mechanism a lot more reliable and avoid
the need for lookaside files or whatever.

I just thought of this so maybe there's a reason it won't work.

Havoc




More information about the dbus mailing list