什么是XPCOM? XPCOM vs COM? [英] What is XPCOM? XPCOM vs COM?

查看:209
本文介绍了什么是XPCOM? XPCOM vs COM?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法理解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?

你能帮我理解一下吗?
谢谢,
Chan。

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

推荐答案



它与COM有什么不同?

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

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

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


b

What makes it cross platform?

它是在由Mozilla开源项目的贡献者移植到许多平台的库中实现的。你可以为任何你想要的平台构建它或下载一个二进制文件,并且在极其遥远的可能性,你想在一个尚未支持的平台上使用它,它应该是直接自己移植。

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?

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

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.

这是通过组件发布定义良好的接口,使用一种名为 IDL (或者,在XPCOM的情况下,为 XPIDL )。这些接口使用在每种支持语言中具有映射的良好定义的类型。每个接口都从公共基本接口继承,这提供了引用计数和类型推断的标准方法(称为 IUnknown 在COM和 nsISupports

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?

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

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. :)

这篇关于什么是XPCOM? XPCOM vs COM?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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