- DCOP
-
For the use of this acronym as it pertains to Artificial Intelligence, see Distributed constraint optimization.
DCOP, which stands for Desktop COmmunication Protocol, is a light-weight interprocess and software componentry communication system. The main point of this system is to allow applications to interoperate, and to share complex tasks. Essentially, DCOP is a ‘remote control’ system, which allows an application or a script to enlist the help of other applications. It is built on top of the X Window System’s Inter-Client Exchange protocol.
The use of DCOP provides extensive new capabilities, without requiring entirely new applications to be written, as might otherwise be the case. KDE applications and the KDE libraries make heavy use of DCOP and most of the KDE applications can be controlled by scripts via the DCOP mechanism. DCOP was replaced by D-Bus in KDE Software Compilation 4.
In modern KDE systems, every KDE application supports a basic set of DCOP interfaces, even if the programmer of the application did not explicitly code in such support. For instance, every application automatically supports the “quit” command to close the application.
There is a command-line tool called ‘dcop’ (note the lower-case letters) that can be used for communication with the applications from the shell. ‘kdcop’ is a GUI tool to explore the interfaces of an application.
For example, the KDE desktop provides a way to display different wallpapers at timed intervals. However, it does not directly provide an interface for changing to the next wallpaper, if the current one does not fit your mood. Neither does it provide a way of permanently removing desktop wallpapers that you decide you do not like, after seeing them as actual wallpaper on your screen.
These features can be added in a few moments, however, using dcop. The command:
$ dcop kdesktop KBackgroundIface changeWallpaper
will switch to the next wallpaper from a shell, and the command:
$ dcop kdesktop KBackgroundIface currentWallpaper 1
will get the filename of the wallpaper on desktop 1. (KDE, and most X environments, support multiple ‘virtual’ desktops for organizing work.) By combining the two in a short shell script, you can switch to the next wallpaper, then delete the previous wallpaper, like so:
OLDWALLPAPER=`dcop kdesktop KBackgroundIface currentWallpaper 1` dcop kdesktop KBackgroundIface changeWallpaper rm "$OLDWALLPAPER"
As you can see, DCOP makes it possible to add new features that were never envisaged when an application was first created.
DCOP model
The model is simple. Each application using DCOP is a client. They communicate to each other through a DCOP server, which functions like a traffic director, dispatching messages/calls to the proper destinations. All clients are peers of each other.
Two types of actions are possible with DCOP: "send and forget" messages, which do not block, and "calls," which block waiting for some data to be returned.
Any data that will be sent is serialized (also referred to as marshalling in CORBA speak) using the built-in QDataStream operators available in all of the Qt classes. There is also a simple IDL-like compiler available (dcopidl and dcopidl2cpp) that generates stubs and skeletons. Using the dcopidl compiler has the additional benefit of type safety.
D-Bus, a message bus system standardized by freedesktop.org, was heavily influenced by the DCOP system and replaces DCOP in KDE Software Compilation 4.
See also
- Portable object cross language cross platform Object Model definition
- CORBA Common Object Request Broker Architecture, cross language cross platform object model
- Freedesktop.org D-Bus current open cross language cross platform Object Model
- GNOME Bonobo deprecated GNOME cross language Object Model
- 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
- IBM System Object Model SOM, a component system from IBM used in OS/2
- Java Beans
- Java Remote Method Invocation (Java RMI)
- Internet Communications Engine
- Language binding
- Foreign function interface
- Calling convention
- Name mangling
- Application programming interface - API
- Application Binary Interface - ABI
- Comparison of application virtual machines
- SWIG opensource automatic interfaces bindings generator from many languages to many languages
External links
KDE Community People Matthias Kalle Dalheimer · Matthias Ettrich · Adriaan de Groot · Frank Karlitschek · Celeste Lyn Paul · Nuno Pinheiro · Cornelius Schumacher · Aaron Seigo · David VignoniSoftware Compilation Workspaces Applications Development Education Games Graphics digiKam · Gwenview · Karbon14 · KColorEdit · KolourPaint · KPhotoAlbum · KPovModeler · Krita · KSnapshot · Okular · SkanliteInternet Multimedia Office Flow · KAddressBook · Kexi · Kile · KMyMoney · Kontact · KOrganizer · KPilot · KWord · Plan · Stage · Tables · Tellico · WordsSystem Utilities Platform Packages KDELibs · KDEBase · Accessibility · Administration · Bindings · Education · Games · Graphics · Multimedia · Network · PIM · SDK · Utils · Web Dev · Calligra Suite · KOffice · ExtragearCategory • Project • Commons • Template Inter-process communication in computing Methods File · Memory-mapped file · Message passing · Message queue and mailbox · Named pipe · Anonymous pipe · Pipe · Semaphore · Shared memory · Signal · Sockets : Internet and Unix domainSelected protocols
and standardsLibraries
and frameworksChannel · D-BusCategories:- Inter-process communication
- KDE Platform
- Software that uses Qt
Wikimedia Foundation. 2010.