D-Bus
| Developer(s) | Red Hat and the community |
|---|---|
| Stable release | 1.4.16[1] / September 21, 2011 |
| Operating system | Cross-platform |
| Type | Inter-process communication |
| License | GNU General Public License or Academic Free License 2.1[2] |
| Website | www.freedesktop.org/wiki/Software/dbus |
D-Bus (Desktop Bus) is a simple inter-process communication (IPC) open-source system for software applications to communicate with one another. Heavily influenced by KDE2–3's DCOP system, D-Bus has replaced DCOP in the KDE 4 release. An implementation of D-Bus supports most POSIX operating systems, and a port for Windows exists. It is used by Qt 4 and GNOME. In GNOME it has gradually replaced most parts of the earlier Bonobo mechanism.
Red Hat operates as the primary developer of D-Bus as part of the freedesktop.org project.
Contents |
[edit] Design
D-Bus is a message bus system, a simple way for applications to talk to one another. D-Bus supplies both a system daemon (for events such as "new hardware device added" or "printer queue changed") and a per-user-login-session daemon (for general inter process communication needs among user applications). Also, the message bus is built on top of a general one-to-one message passing framework, which can be used by any two apps to communicate directly (without going through the message bus daemon) Most systems implement a privileged system channel, plus a private channel for each logged-in user. So that available information in the D-Bus registry can be restricted.
D-Bus works with Unix sockets between applications and daemons (applications communicate with each other through a fork of the D-Bus daemon), but work is being done to create a 'peer-to-peer' socket type in the Linux kernel able to route messages between applications, leaving the daemon as a top-level manager.[3] The main advantage of this new approach is that it improves speed by halving the number of memory-copy operations.
[edit] Architecture
D-Bus has three architectural layers:[4]
libdbus- a library that allows two applications to connect to each other and exchange messagesdbus-daemon- a message-bus daemon executable, built onlibdbus, that multiple applications can connect to. The daemon can route messages from one application to zero or more applications, thereby implementing the publish/subscribe paradigm.- wrapper libraries based on particular application frameworks
The design of D-Bus addresses two specific cases:
- communication between desktop applications in the same desktop session; to allow integration of the desktop session as a whole, and address issues of process lifecycle
- communication between the desktop session and the operating system, where the operating system would typically include the kernel and any system daemons or processes
[edit] Mechanisms
Each application using D-Bus contains objects that usually map to GObject, QObject, C++ objects, or Python objects. Each D-bus object operates as an instance rather than as a type. Messages received over a D-Bus connection get routed to a specific object, not to the application as a whole. In this way, D-Bus resembles software componentry, as it appears to users as if they are interacting with an object across the IPC connection, whether or not there is an object on the other side.
To allow messages to specify their destination object, the system needs a way to identify and address an object. For this purpose, D-Bus defines a name for each object. The name looks like a filesystem path, for example an object could have the name /org/kde/kspread/sheets/3/cells/4/5. D-Bus encourages human-readable paths, but developers are free to create an object named /com/mycompany/c5yo817y0c1y1c5b if it makes sense for their application.
The D-Bus objects' names are namespaced to help with independently developing code modules[citation needed]. Namespaces are generally prefixed with the developer's reversed domain name components (e.g. /org/kde).
[edit] See also
- Remote procedure call
- CORBA Common Object Request Broker Architecture, cross language cross platform object model
- GNOME Bonobo deprecated GNOME cross language Object Model
- KDE DCOP deprecated KDE interprocess and software componentry communication system
- KDE KPart KDE component framework
- XPCOM Mozilla applications cross Platform Component Object Model
- COM Microsoft Windows only cross language Object Model
- DCOM Distributed COM, extension making COM able to work in networks
- Common Language Infrastructure current .Net cross language cross platform Object Model
- Java Remote Method Invocation (Java RMI)
- Foreign function interface
[edit] References
- ^ "Announcing dbus 1.4.16". 2011-09-21. http://lists.freedesktop.org/archives/dbus/2011-September/014707.html. Retrieved 24 November 2011.
- ^ Havoc's Blog July, 2007
- ^ http://alban-apinc.blogspot.com/2011/12/d-bus-in-kernel-faster.html
- ^ "Get on the D-BUS". Linux Journal. http://www.linuxjournal.com/article/7744. Retrieved 2008-01-23.
5. ^ http://dbus.freedesktop.org/
[edit] External links
- D-Bus at the Freedesktop.org home page
- Introduction to D-Bus on the Freedesktop.org wiki
|
||||||||||||||||
|
|||||||||||