.net - .NET 是 "all COM underneath"吗?

多年来,我一直很欣赏 Juval Lowy 在 .NET 开发方面的教学和指导。他还写了我最喜欢的书之一:Programming .NET Components。

然而,在最近的 DotNet Rocks 播客(2010 年 1 月)中,他在讨论 WCF/COM 和 .NET 时发表了一些令我非常惊讶的评论:

Juval Löwy: ..... in .NET, lo and behold, every class here is a COM object. We know that. In fact, it's much more than COM because we've got the git compiling, we've got garbage collection, we've got the Security Stack....

Carl Franklin: Well, you should clarify that though. I mean, every object is not a COM object. Every object has the capabilities that a COM object does, but the .NET Framework isn't a COM library.

Juval Löwy: No, no. First of all .NET is actually built on top of COM. It's all COM underneath.

然后,在卡尔富兰克林要求澄清此评论后:

Carl Franklin: Yeah, I get that. My question was is .NET built on COM?

Juval Löwy: Of course, it all COM underneath.

Carl Franklin: No. I know it's intertwined and it's required, but when you new up a .NET object you're not creating a COM object.

Juval Löwy: You're creating a .NET object, but all I'm saying is that .NET is built underneath. It's all C++ and COM.

Carl Franklin: It is C++ but you're not registering a COM object through the COM interface. It isn't all that stuff unless you specifically do that.

Juval Löwy: But some of the stuff is using COM underneath, but that's beside the point. Forget about how it's made.

您如何阅读这些评论?

虽然我了解(并已确认)某些系统程序集是用非托管 C++ 编写的,但说它们是“所有下面的 COM”是否也有效?

我假设完全有可能编写与 COM/ATL/ActiveX 完全无关的 .NET CLI 兼容 C++ 程序集?

这里是 PDF transcript对于有问题的播客。请参见第 7 页。

最佳答案

我认为他在谈论 CLR 的底层实现。据我了解,他不是在谈论 COM 和 .NET 世界的交互。他只是告诉我们他们在运行时的实现中使用了 C++ 和 COM。

I was under the assumption it is perfectly possible to write .NET CLI compliant C++ assemblies that have absolutely nothing to do with COM / ATL / ActiveX?

是的,您可以使用 C++/CLI 创建与 COM 无关的纯 MSIL 程序集。

关于.net - .NET 是 "all COM underneath"吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2280639/

相关文章:

c++ - std::map 如何提供常量 size() 操作?

c++ - 如何在编译时检查结构的大小?

c++ - 访问另一个子类中基类的 protected 成员

c++ - 如何在 C++ 中将 unsigned char* 转换为 std::string?

c++ - std::pair 的顺序是否明确?

c++ - 我不明白这个 C/C++ 笑话

C++ 异常 - 将 c-string 作为异常抛出是不是很糟糕?

c++ - 为什么 std::fstream 类不采用 std::string?

c++ - 为什么数组不能作为函数参数传递?

c++ - OSX - 用通过 Homebrew 安装的 4.9 替换 gcc 版本 4.2.1