是.NET“所有COM在下面”?

我多年来一直是Juval Lowy在.NET开发领域的教学和指导的仰慕者。他也写了我最喜欢的书之一:编程.NET组件。

然而,在最近的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在下面”?

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

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

这几乎好像Löwy故意试图在他说的话不清楚。我没有听播客,但根据乌姆勒斯的评价,我估计英语不是他的第一语言。

在.NET中使用的一些对象真的是COM对象的包装器。和一个.NET对象,你创建做了很多COM应该做的更多,没有COM的讨厌的烦恼。我不认为声明“它是所有COM下面”是准确或清楚。

我希望面试已经与Jeff Richter。 😉

http://stackoverflow.com/questions/2280639/is-net-all-com-underneath

本站文章除注明转载外,均为本站原创或编译
转载请明显位置注明出处:是.NET“所有COM在下面”?