Proposing a convention for null ObjectPaths

Simon McVittie simon.mcvittie at collabora.co.uk
Tue Aug 14 05:25:08 PDT 2007


On Fri, 10 Aug 2007 at 13:23:01 -0400, Ryan Lortie wrote:
> In the case that C# lacks non-null reference types then all C#
> references should really just all be mapped to "maybe object" dbus types
> since, really, this is what they actually are.

For any type we implement in D-Bus, it must be possible to send and
receive it in any of the bindings/implementations. The mapping needn't be
pretty, but it must exist. (Of course, the more natural it is, the better.)

Otherwise we'd end up with a crazy situation where certain specifications can
only be implemented in certain languages - for instance, Telepathy has
methods that return a (non-null) object path (and I suspect most non-trivial
D-Bus APIs do too), so if C# nullable object paths were mapped to signature
'mo' and there were no non-nullable object paths, you wouldn't be able to
implement a Telepathy connection manager (or most other non-trivial
D-Bus APIs) in C#.

I'm not sure to what extent we should be requiring implementations to be able
to distinguish between the different types. For instance, dbus-glib can't
tell the difference between an Int16 and and Int32, because they both
map to G_TYPE_INT; so it's impossible to write Echo(v) -> v correctly using
dbus-glib, because if you put in an Int16, you get an Int32 of the same
numeric value out.

In practice, this probably means "if you receive a variant,
be lenient about what types are allowed to be in it".

	Simon


More information about the dbus mailing list