Re: impending gdbus merge

Hey Simon,

On Fri, May 7, 2010 at 6:31 AM, Simon McVittie
<simon mcvittie collabora co uk> wrote:
> On Thu, 06 May 2010 at 16:36:45 -0400, David Zeuthen wrote:
>> Btw, for what it's worth, the way the symbol/struct names are set up
>> right now is like this: GDBus*/g_dbus_* refers to routines that don't
>> care whether the connection is to a message bus, while GBus*/g_bus_*
>> refers to routines where the connection is known to be to a message bus.
> So: GDBus is like dbus-python's dbus.connection.Connection, which could be
> peer-to-peer or to a dbus-daemon; whereas GBus is like dbus-python's
> dbus.bus.BusConnection, which is known to be to a dbus-daemon?

Well, there's no separate class or type for a message bus connection
in GDBus. There is however, a way to request that the Hello() method
is invoked after authenticating the connection... you can also request
to auth as the server or the client or no auth at all.

So it's not really the same, no.

> That seems a subtle distinction to convey with an added "D"; libdbus uses
> dbus_connection_foo vs. dbus_bus_foo, which is where dbus-python's naming
> comes from.

(I think the libdbus thing this is mainly to avoid colliding with
existing symbols already prefixed with bus_...)

> I agree that g_dbus_connection_foo vs. g_dbus_bus_foo seems long and
> unwieldy, though.

Well, the stuff in the (socalled) GBus namespace just consists of
functions (not methods or types or classes). Specifically g_bus_get()
is just a C function that gives you an (singleton) instance of a
object of type GDBusConnection using the address for the system bus.
Ditto, g_bus_watch_name() is just a C function, not a method on a
class or some GType instance.

(Not that I think it really matters that the (socalled) GBus namespace
only contains C functions and not e.g. GObject "methods"...)

> Perhaps it would be sufficient to drop the naming convention, have one
> shared namespace, and just have a standard piece of boilerplate to document
> the few bus-specific functions, like "this method is only useful on a
> connection to a bus daemon"?

First, I'd like someone to properly explain why the current naming is

I also think different people may use the word "namespace" in
different ways here and that's why I prefixed the usage of it with
(socalled) above... is there a more precise definition that the good
old "prefix of symbols and data structures" one? Maybe something
related to GObject Introspection?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]