With the BlueZ meeting over and the suggestion made by the developers it seems we had made some very good decisions while designing the BlueZ 4.x. There has been some talks regarding this before, specially regarding round trips which have a very bad impact in performance, but I never really saw anyone commenting about using DBus as the only API. So how different it is to design a Specification to an API? Well lets start with a Specification:
DBus Specification
It is almost as defining a protocol over DBus, so its documentation normally define the data types, how they should be interpreted and so on. This directly reflect both in the server and in the client code, since the specification may define its own data types this is no longer only about DBus, but sometimes a real stack over it (see telepathy or NetworkManager).
Pros:
- Easy to adapt, specially when the applications involved share the same libraries.
- Very efficient, it doesn't depend on DBus 'native' types it is easy to avoid round trips and heavy use of bus.
Cons:
- Very hard to test and document, introspection may become meaningless in some cases.
- Extra build time dependencies may be required
- The more heterogeneous are the applications the worse it will be to maintain.
DBus API
It is almost the opposite, it only uses DBus native data types, so the introspection data is normally enough to the developer to understand how to use the API (or not :D). As opposed to an specification the documentation might be very simple, actually this seems quite natural to me as one can use d-feet to explore it became quite easy to understand and test.
Pros:
- Easy to test and document
- No extra build time dependency
- When done right can make use of args in matching rules
Cons:
- Not so efficient as it may require some extra round trips or signals.
As you can see DBus can be used in very different ways, while an API is probably more suitable for system daemons, where the use of complex data types makes it difficult to became adopted by the various languages/toolkit as it may generate language/toolkit specific bindings where the maintenance become a nightmare, in the other hand a specification may fits the needs of applications that want to exchange very specific data where the applications interested in the data are probably part of the same package/solution and share the same dependencies/libraries.
Wednesday, October 7, 2009
Friday, October 2, 2009
Europe trip
Here Im in Germany, Stuttgart to be more precise, for BlueZ meeting and UPF. Meeting already started and we will probably make the notes available here: http://www.bluez.org/development/. I will comment about the meeting latter on when I got some time.
UPF will be starting next week, oct 4th to 8th, and since this is my first time attending to such event I think there will be a lot of things to blog about, and finally after all the fun with bluetooth/BlueZ I will be heading to Amsterdam for the Maemo Summit where I will be participating on the BlueZ bof.
Thats it for today :D
UPF will be starting next week, oct 4th to 8th, and since this is my first time attending to such event I think there will be a lot of things to blog about, and finally after all the fun with bluetooth/BlueZ I will be heading to Amsterdam for the Maemo Summit where I will be participating on the BlueZ bof.
Thats it for today :D
Subscribe to:
Posts (Atom)