gpt4 book ai didi

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

转载 作者:IT老高 更新时间:2023-10-28 12:35:34 24 4
gpt4 key购买 nike

多年来,我一直很欣赏 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com