Bug 24664

Summary: make Interfaces property more generic
Product: Telepathy Reporter: Danielle Madeley <danielle>
Component: tp-specAssignee: Telepathy bugs list <telepathy-bugs>
Status: RESOLVED NOTOURBUG QA Contact: Telepathy bugs list <telepathy-bugs>
Severity: enhancement    
Priority: lowest    
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:

Description Danielle Madeley 2009-10-21 15:28:17 UTC
At the moment, to read an object's interfaces, you have to know what type of object it is, and then request 'Interfaces' from the correct interface. This is kinda sucky.

I'm proposing adding an 'Interfaces' property to a new interface (e.g. 'org.freedesktop.Telepathy') that is implemented by all Telepathy objects. Then deprecating the existing GetInterfaces and Interfaces properties throughout Telepathy.
Comment 1 Simon McVittie 2009-11-04 07:21:15 UTC
I'm inclined to reject this, or at least the part where existing Interfaces properties are deprecated:

* If you don't know what an object is, why are you using it? :-P
* If you do know what it is, you can do a single GetAll() call to get both Interfaces and (e.g.) a connection's Status, or all of an Account's properties, or most of a Channel's properties - round-trip reduction.

Thoughts from anyone else?
Comment 2 Danielle Madeley 2009-11-04 14:11:16 UTC
Your GetAll() case is compelling.

My specific case came from my work with the JS bindings, it would be nice to be able to request the Interfaces property and find out what interfaces you need to bind to the object without having to look up the object path, interpret it and then make a specific request.
Comment 3 Simon McVittie 2009-11-05 08:10:55 UTC
Spec cabal thoughts:

This would only be useful in the presence of a GetAllForManyInterfaces() method, which is a job for D-Bus upstream.

This is also basically a workaround for deficiencies in Introspect(), which is *also* a job for D-Bus upstream. The deficiencies we care about are:

* It's a blob of XML which needs parsing, whereas if it was a normal D-Bus data structure, we'd already know how to parse it

* Bindings (dbus-glib, dbus-python) assume that every class has static Introspect() output, whereas we want to be able to (e.g.) drop the Avatars interface from Haze connections that are to an IRC server (and in extreme cases, we might not even know what we can do until we connect to the server, e.g. the OLPC "Gadget" server extension in Gabble).

The way to solve this would be to do some D-Bus upstream work in our copious free time, so, NOTOURBUG.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.