Migrating to GDBus

Conceptual differences
API comparison
Owning bus names
Creating proxies for well-known names
Client-side GObject bindings
Exporting objects

Conceptual differences

The central concepts of D-Bus are modelled in a very similar way in dbus-glib and GDBus. Both have a objects representing connections, proxies and method invocations. But there are some important differences:

  • dbus-glib uses libdbus, GDBus doesn't. Instead, it relies on GIO streams as transport layer, and has its own implementation for the the D-Bus connection setup and authentication. Apart from using streams as transport, avoiding libdbus also lets GDBus avoid some thorny multithreading issues.

  • dbus-glib uses the GObject type system for method arguments and return values, including a homegrown container specialization mechanism. GDBus relies uses the GVariant type system which is explicitly designed to match D-Bus types.

  • The typical way to export an object in dbus-glib involves generating glue code from XML introspection data using dbus-binding-tool. GDBus does not (yet?) use code generation; you are expected to embed the introspection data in your application code.