[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    Re: Abput DCOP
From:       Thiago Macieira <thiago () kde ! org>
Date:       2006-03-27 10:59:35
Message-ID: 200603271259.35337.thiago () kde ! org
[Download RAW message or body]

[Attachment #2 (multipart/signed)]


Richard Dale wrote:
>On Sunday 26 March 2006 08:38, Andreas Silberstorff wrote:
>> And where DCOP was simple, D-Bus is designed to be interoperable
>>
>> > with other languages other than C++/Qt.
>
>DCOP is very easy to make interoperate with other languages. Athough
> some of the KDE interfaces use method overloading on the arg types,
> which is a bit more tricky. 

Interestingly, D-Bus doesn't solve this problem either.

The specification and the library don't preclude overloading with 
different parameters at all. It's actually up to each binding to decide 
if and how they will support that. Some bindings might do automatic 
type-conversion and call the same function; others may allow method 
overloading by parameters (such as is the case of the Qt4 binding).

But, the consensus on the D-Bus mailing list and IRC channel is that 
interfaces that are supposed to be interoperable shouldn't use that kind 
of "fancy stuff". You'll still be able to use them for your own private, 
non-interoperable communication.

>I hope it will be just as easy to interface with DBUS. I think it will
> be up to the developers of C++ apps to ensure they don't go overboard
> with nested custom structs or whatever with DBUS, and stick to things
> like simple string lists or hashes which can be easily represented in
> any of the above languages.

Indeed. D-Bus doesn't allow passing of arbitrary types. You can only send 
a few, well-known types, plus a few compositions of those (arrays and 
maps).

It also supports a type called "struct", but I have not gone deeper into 
supporting it in the Qt4 binding. There are several limitations in using 
it, including the fact that you can't generate code that receives 
an "unnamed struct containing two ints and one string", for instance.

Finally, if an application *really* needs to pass a complex type, it can 
still do so. Just encode it with a QDataStream and send the QByteArray. 
This will not be, of course, interoperable.

-- 
Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
  thiago.macieira (AT) trolltech.com     Trolltech AS
    GPG: 0x6EF45358                   |  Sandakerveien 116,
    E067 918B B660 DBD1 105C          |  NO-0402
    966C 33F5 F005 6EF4 5358          |  Oslo, Norway

[Attachment #5 (application/pgp-signature)]

>> Visit http://mail.kde.org/mailman/listinfo/kde-devel#unsub to unsubscribe <<


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic