XPCOM是什么? XPCOM 与 COM?

发布于 2024-09-28 02:09:40 字数 162 浏览 6 评论 0 原文

我无法理解 XPCOM。它与 COM 有什么不同?是什么让它跨平台?

它是一个包含一组可用于完成某些工作的库的框架吗?

另外,组件对象模型是否意味着每个功能都在组件中实现,因此我们可以在不知道详细实现的情况下使用它?

你能帮我理解这一点吗? 谢谢, 陈.

I have trouble understanding XPCOM. How is it different from COM? What makes it cross platform?

Is it a framework with a set of libraries that you can use to do some jobs?

Also, does Component Object Model means every functionality is implemented in component so we can use it without knowing the detail implementation?

Can you someone help me understand this please?
Thanks,
Chan.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

三月梨花 2024-10-05 02:09:40

我无法理解 XPCOM。
它与 COM 有什么不同?

XPCOM 是 Mozilla 自己的跨平台(因此称为 XP 位)版本的 COM。

是什么让它跨平台?

它是在一个库中实现的,该库已被 Mozilla 开源项目的贡献者移植到许多平台。您可以为您希望的任何平台构建它或下载二进制文件,并且在极少数情况下您想在尚未支持的平台上使用它,您自己移植它应该很简单。

此外,组件对象模型
意味着每个功能都是
在组件中实现,因此我们可以使用
在不知道细节的情况下
实施?

是的,准确无误。这个想法是建立一个独立于语言的框架,使不同的组件能够进行通信和交互,而不需要任何特定组件所使用的语言的任何特殊知识。因此,例如,javascript 代码可以调用 C++ 代码。

这是通过使用名为 IDL (或者,在 XPCOM 的情况下,XPIDL)。这些接口利用定义良好的类型以及每种支持语言的映射。每个接口都继承自一个公共基接口,该接口提供了引用计数和类型推断的标准方法(称为 IUnknownnsISupports)。

有人能帮我理解一下吗
请问这个?

在在线资源方面,MSDN(针对 COM)MDC(适用于 XPCOM)。如果您想真正了解 COM 的动机以及为什么它是这样的,我建议您选择 Don Box 基本 COM。当然,如果您有任何具体问题需要解答,您可以随时来这里询问他们。 :)

I have trouble understanding XPCOM.
How is it different from COM?

XPCOM is Mozilla's own, cross-platform (hence the XP bit) version of COM.

What makes it cross platform?

It is implemented in a library that has been ported to many platforms by contributors to the Mozilla open-source project. You can build it or download a binary for any platform that you wish and, in the extremely remote possibility that you want to use it on a platform that is not already supported, it should be straightforward to port it yourself.

Also, does Component Object Model
means every functionality is
implemented in component so we can use
it without knowing the detail
implementation?

Yes, spot on. The idea is for a language-independent framework that enables different components to communicate and interact, without requiring any special knowledge of the language that any particular component is implemented in. So javascript code can call C++ code, for instance.

This is achieved by components publishing well-defined interfaces, using a language called IDL (or, in XPCOM's case, XPIDL). These interfaces make use of well-defined types with mappings in each of the supporting languages. Every interface inherits from a common base interface, which provides standard methods for reference-counting and type-inference (called IUnknown in COM and nsISupports in XPCOM).

Can you someone help me understand
this please?

In terms of online resources, there are dedicated areas on both the MSDN (for COM) and the MDC (for XPCOM). If you want to really understand the motivation for COM and why it is the way it is, I recommend picking up Don Box's Essential COM. And of course, if you have any specific questions that need answering, you can always come here to ask them. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文