General questions to DBua

Havoc Pennington hp at redhat.com
Tue Nov 29 08:48:03 PST 2005


On Mon, 2005-11-28 at 19:23 +0100, Matthias Grimm wrote:
> 
> 3. What is the difference between a "Service" and an "Interface"? It was
>    really confusing for me that in the complete DBus documentation both
>    values are always the same. In my understanding a "Service" is like a
>    office I could go to for certain dutys and the "Interface" tells me
>    what I can do (signals and methods) in this office. Am I right here?

Did you find the explanation of this in the tutorial:
http://dbus.freedesktop.org/doc/dbus-tutorial.html
also this picture:
http://dbus.freedesktop.org/doc/diagram.png

If they weren't useful maybe they need more work.

> 5. Why is the DBus API so complicated? Would have a simple OpenMsgPort(),
>    SendMsg(), ReceiveMsg() and CloseMsgPort() have done it too? Why has
>    everybody fear to use or at least explain the usage of the native
>    DBus API? Actually I won't use any binding to anything I don't need.
>    In other words: Why should I use libdbus-glib if my program doesn't
>    use glib (or any other lib a binding exists for)?

You don't have to use the bindings, you'll just have to reinvent wheels
and do more typing.

If you do blocking IO then the API you use does look about like
open/send/receive/close, there isn't much else to it. Especially with
the patch to add connection_read_write()

>    It might be correct that most of the native DBus API is only usefull
>    for bindings, but which functions are this? I really missed a
>    separation of binding-only functions and message bus functions in the
>    docs.

There isn't really a clear separation ... if you aren't using bindings
to varying degrees you end up writing your own simple "binding" in your
program. So how much API you use depends on how complicated your program
is (if you have a main loop with poll(), then you use more API than if
you just block on the dbus socket, if you want to handle out-of-memory
errors you write more code, etc.)

Havoc




More information about the dbus mailing list