是否有一个相当于COM在* nix系统?如果没有,什么是* nix的方法来重新可用性? [英] Is there an equivalent to COM on *nix systems ? If not, what was the *nix approach to re-usability?

查看:176
本文介绍了是否有一个相当于COM在* nix系统?如果没有,什么是* nix的方法来重新可用性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有Windows COM的理解和它背后的想法。我想了解,如果* nix系统甚至有同等或他们为什么不?

I have an understanding of windows COM and the ideas behind it. I am trying to understand if *nix systems even have an equivalent or why they don't?

推荐答案

Unix的模型是围绕相互通信,通过套接字,管道,信号,和命令行轻量级进程的概念建造的。从历史上看,UNIX没有线程(POSIX线程模型只是10岁左右IIRC),但在Unix上的进程一直比在Windows便宜得多,所以这是更好的性能,以因子功能集成到不同的可执行文件,而不是允许单一的程序来生产大型和单片。

The Unix model is built around the idea of lightweight processes that communicate with each other, through sockets, pipes, signals, and command lines. Historically, Unix didn't have threads (the POSIX thread model is only about 10 years old IIRC), but processes on Unix have always been much cheaper than on Windows, so it was more performant to factor functionality into separate executables than to allow a single program to grow large and monolithic.

在COM中,可以定义二进制接口,允许共享内存通信。 COM被绑定到的面向对象的范例。在经典的Unix模型,您可以定义面向流的接口,允许在管道沟通,没有共享内存。从概念上讲,这是更接近一个的功能的编程范例。

In COM, you define binary interfaces that allow shared-memory communication. COM is tied to an object-oriented paradigm. In the classic Unix model, you define stream-oriented interfaces that allow communication over pipes, without shared memory. Conceptually, this is much closer to a functional programming paradigm.

Unix的模式鼓励决策可以由一个轻量级的壳很容易地连接在一起的小程序,而COM模式鼓励制作,揭露出可以被其他大型程序中重用组件大型程序。这真是一个苹果和桔子比较,因为这两个模型提供了不同的方案的优点和缺点。

The Unix model encourages making small programs that can be easily coupled together by a lightweight "shell", while the COM model encourages making large programs that expose "components" that can be reused by other large programs. It's really an apples-and-oranges comparison, since both models provide benefits and drawbacks for different scenarios.

当然,现代的Unix系统可以有COM般的设施。 Mozilla有XPCOM,建立在相同的原则,COM一个跨平台的框架。对于GNOME的Bonobo使用很长一段时间,这是概念上非常类似于Microsoft OLE,这是先行者COM。但最新的GNOME版本已经从倭黑猩猩转移走赞成的D-Bus,这更多的是一种事件/消息模式的。

Of course, modern Unix systems can have COM-like facilities. Mozilla has XPCOM, a cross-platform framework built on the same principles as COM. GNOME for a long time used Bonobo, which is conceptually very similar to Microsoft OLE, which was the forerunner to COM. But recent versions of GNOME have been shifting away from Bonobo in favor of D-Bus, which is more of an event/messaging pattern.

这篇关于是否有一个相当于COM在* nix系统?如果没有,什么是* nix的方法来重新可用性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆