Object serialization

Matthew Johnson dbus at matthew.ath.cx
Mon Feb 25 16:15:51 PST 2008

On Mon Feb 25 18:05, Luigi Paioro wrote:
> Hello all!
>    I have been missing from this mailing list for one year, so a lot of 
> stuff certainly have been done but I'm not updated. One of my last 
> issues were concerning the possibility of the object serialization 
> within DBus. Someone suggested me to adopt an object/dictionary map, and 
> send a dictionary instead of introducing an object serialization in the 
> DBus protocol. Of course at that time this was a good solution, but I 
> was wondering whether this issue has been carried forward, defining a 
> formal translation object<->dictionary / dictionary<->object. I could 
> define my private map, but if there were a general map, a standard, 
> agreed upon by the DBus community, I would rather use it.

My opinion is that you should serialize it to the native types
corresponding to the contents of that object. So, if you have a class:

class Foo 
   String name;
   int width;
   int height;
   byte[] colours;

   public Foo()...

then any method to which you wish to pass Foo, would declare either the
signature 'siiay', or the signature '(siiay)' (I'm not bothered which).

Bindings should then provide support for making this easy. This is the
approach which Java DBus takes. This makes it easy for a client written
in a different language, possibly one without well-defined objects, to
interface to your code from just the introspection data. I don't see
that this requires any special support or greed conventions.

Of course, if you're talking about something else, then do say so (-:


D-Bus Java
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/dbus/attachments/20080226/07186e25/attachment.pgp 

More information about the dbus mailing list