Net::DBus and qdbus disagreement
Daniel P. Berrange
dan at berrange.com
Wed Jan 4 04:20:26 PST 2012
On Wed, Jan 04, 2012 at 12:10:05PM +0000, Simon McVittie wrote:
> On Sun, 18 Dec 2011 at 21:29:42 +0000, Daniel P. Berrange wrote:
> > Ok, so this is showing that there are 3 methods exported in the same
> > interface, all with the same name. I did not realize that this is
> > allowed by DBus.
>
> D-Bus is both a message passing system, and an object model built on that
> message passing system. I've been trying to make the layering clearer in the
> spec, but am still rather held up by lack of reviews for my queue of pending
> patches - reviews on Bugzilla welcome, even from non-committers!
>
> Any call is allowed by the message passing system, which operates at a
> considerably lower level than the object model used by most bindings.
Yes, my bad terminology in the quoted text above. What I meant to say
was that I did not realize this allowed by /the DBus Introspection XML/
format.
> It's ambiguous whether the object model is meant to allow overloading (two
> methods with the same name and different "in" arguments) or not. In my opinion,
> there is a "portable subset" of D-Bus that interface designers
> should use, and that portable subset doesn't include overloading.
That sounds reasonable. None the less, I am aiming to make it possible
to use Net::DBus as a client, in two methods with same name scenario.
>
> > The Net::DBus code is assuming that method names
> > are unique within the scope of a single interface, so it is only
> > able to show you a single method.
>
> Many other bindings, particularly those that try to "hide" D-Bus signatures
> (at least dbus-glib and dbus-python), have the same problem. I believe the
> only "signature-hiding" binding that supports method overloading like this
> is Qt.
>
> GDBus avoids this by having the signature appear explicitly in every method
> call. I think dbus-python might also cope if you use an explicit signature.
Interesting, I'll take a look at the python binding for inspiration in how
to solve it most effectively for Perl.
Regards,
Daniel
--
|: http://berrange.com -o- http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org -o- http://virt-manager.org :|
|: http://autobuild.org -o- http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org -o- http://live.gnome.org/gtk-vnc :|
More information about the dbus
mailing list