using dbus in the platform

Thiago Macieira thiago at kde.org
Tue Oct 9 11:06:02 PDT 2007


Em Tuesday 09 October 2007 19:14:48 Olivier Galibert escreveu:
> Except that this convention[1] is crap when you need to use the
> library to write bindings for another language, especially an
> interpreted one.  You kill any hope of having a good interaction with
> a native-language debugger.  "Sorry, the application died in a native
> call, we can not give you a backtrace or variables state".

I don't agree.

If the API contract says "you shall not pass an invalid path", then you 
shouldn't do it! The missing caveat here is that it's not easy to check for 
an invalid path, unlike the check for != NULL.

If there were a function to do the check -- and I really think there should be 
one, since I implemented my own and Simon implemented another just to comply 
with this requirement -- then the binding function would simply check its 
arguments at the beginning of the function and throw an exception if they're 
invalid.

This would avoid a lot of repeated and unnecessary checks. Imagine if the path 
were used sequentially in several calls... why check it at every single 
libdbus entry point, if you can check it when it first got to you?

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.freedesktop.org/archives/dbus/attachments/20071009/3162df0b/attachment.pgp 


More information about the dbus mailing list