What is the closest thing to Windows COM/DCOM in t

2019-03-11 08:15发布

Anything higher-level, and more comprehensive than pipes/sockets?

7条回答
可以哭但决不认输i
2楼-- · 2019-03-11 08:44
D-Bus
  • D-Bus uses a logical "Bus" over which connected applications may communicate
  • communication takes place via a simple object model that supports both RPC and publish-subscribe mechanisms
  • D-Bus includes a standard introspection mechanism for the run-time querying of object interfaces, applications connected to the bus may query for the availability of objects, call remote methods on them, and request notification for the signals they emit
  • before: GNOME Bonobo, KDE DCOP, CORBA, Sun RPC... nowadays people seem to prefer D-Bus
UNO
  • interface based component model, as are COM and CORBA
  • all UNO-interfaces must be derived from a interface that offers acquire, release, and a queryInterface method (comparable to COM)
  • the lifetime of UNO-objects is controlled by global reference counting.
  • components communicate only via their interfaces o each component lives in a Uno Runtime Environment (URE), there is no performance overhead for components, that are instantiated within the same URE, e.g., in C++, a call from component A to B is just a virtual call
  • UNO-interfaces are specified in IDL
  • exceptions are used for error handling.
XPCOM
  • similar to Microsoft COM
  • Interfaces in XPCOM are defined in a dialect of IDL called XPIDL
  • disadvantage is that XPCOM adds a lot of code for marshalling objects between different usage contexts, which leads to code bloat in XPCOM based systems

...another alternative to consider might be Java RMI as well

It's also worth to see related questions:
Is there an equivalent to COM on *nix systems ? If not, what was the *nix approach to re-usability?
Analog of COM programming in Linux/UNIX

查看更多
叛逆
3楼-- · 2019-03-11 08:47

For interprocess communication, D-Bus is the standard higher level mechanism. Both GTK and Qt have bindings for D-Bus, most desktop environments (or at least GNOME and KDE) expose various services via D-Bus, and many desktop applications can be controlled via a D-Bus interface. The system bus is also useful for finding out various low level information about the system using standard system services.

KDE4 (built upon Qt4) also includes a technology called KParts, which are often compared to Window's COM.

查看更多
爷的心禁止访问
4楼-- · 2019-03-11 08:48

DCOM is available on Linux. It isn't "the linux way of doing things", but hey, if you want "like DCOM, but Linux" then just use DCOM on Linux and have done...

查看更多
在下西门庆
5楼-- · 2019-03-11 08:54

Yes, there are lots of things, but there isn't one as "Standard" as COM/DCOM. At least, in Windows, COM / DCOM are used by "Windowsish" stuff, and other RPC mechanisms are used by un-"Windowsish" stuff.

Linux doesn't have anything like that, instead things which need higher level RPC protocols typically use whatever their language provides, or a specific library which best suits an app's needs. Examples of that would be RMI in Java, Python's "pyro" module, etc, which will provide (some) functional parity with DCOM.

Corba is a bit heavyweight but some people apparently do use it.

A lot of applications roll their own RPC libraries. Don't do that unless you have to, it's nasty.

查看更多
对你真心纯属浪费
6楼-- · 2019-03-11 08:55

The Mono project jumps to mind. Mostly because the CLR/.NET is the new COM -- after all, COM was initially sold as language independent, binary compatible objects.

I guess DCOM (i.e. COM with a longer wire) would be .NET remoting? Or perhaps some web services with object serialization. I believe Mono supports both.

查看更多
Animai°情兽
7楼-- · 2019-03-11 09:02

You can check out Corba, it works on Linux and Windows as well.

查看更多
登录 后发表回答