Object paths naming conventions?

Havoc Pennington hp at pobox.com
Thu Jul 17 14:07:06 PDT 2008


On Thu, Jul 17, 2008 at 1:49 PM, Sander Jansen <s.jansen at gmail.com> wrote:
> I'm a little bit confused on choosing good names for object paths. My
> program lives on a unique connection name: "org.fifthplanet.gogglesmm"
> Looking at the MPRIS spec
> (http://wiki.xmms2.xmms.se/wiki/MPRIS#The_Object_Hierarchy), they
> expose three objects with the following paths:
> "/"
> "/Player"
> "/Tracklist"

This is not appropriate because it prevents multiple dbus-exported
objects from living in the same process. For example, say GTK+ or
libgnome or something implements an object /org/gtk/atk that is the
root object for accessibility. That would be namespaced to avoid
collision with apps.

Similarly, say an app implements two specs, one is the above MPRIS
thing and another is something else like say a session management
spec. Hopefully both specs didn't decide to use "/"

Bottom line, that spec is polluting the namespace - it's as if a
shared library had a function called "void play()" with no namespace.
It's broken.

An app can contain multiple objects, provided by distinct code
modules. Namespacing is required.

> Now I also seen applications using a more complete path (like in rhythmbox):
> "/org/gnome/Rhythmbox/Shell"
> "/org/gnome/Rhythmbox/Player"

This is correct.


More information about the dbus mailing list