Is .Net Framework biult on top of COM?

  • Thread starter Thread starter laurence chang
  • Start date Start date
L

laurence chang

Hi,

I'm just wondering what's behind of .Net Frameworks. Is .Net Framework
biult on top of COM?

Larry
 
Hi Larry,

Heavens, NO! It doesn't even *like* COM very well. It's a whole new ball
game.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
You can lead a fish to a bicycle,
but you can't make it stink.
 
laurence said:
Hi,

I'm just wondering what's behind of .Net Frameworks. Is .Net Framework
biult on top of COM?

It depends on what you mean by 'built on COM'. It is certainly built
upon the lessons learned from COM, and COM features like interface
programming are a part of .NET. Rotor, the shared source version of .NET
shows that the runtime is written in unmanaged C++, using C++ objects
not COM objects. However, the internal workings of the runtime are
available through COM: Microsoft provide a COM object that gives access
to the runtime, and unmanaged code calling this object can do some
things that managed code cannot do (one example is to get access to the
default appdomain).

The framework library is between 88% and 96% managed (depending on the
version). I have analysed various versions of the library and present my
results here:

http://www.grimes.demon.co.uk/dotnet/dotnetWrappers.htm

It is interesting to analyse remainder of the library (ie the code that
is not managed). There are several options: platform invoke, COM
interop, embedded native code or internalcall. The internalcall methods
are unmanaged and are provided by the unmanaged DLLs in the runtime.
Embedded native code are actual x86 machine code in an assembly and
although there are a few methods like this, they are actually calls to
unmanaged DLLs, so they are equivalent to platform invoke. Platform
invoke are calls to unmanaged DLLs, mostly the Win32 system DLLs. And
finally there are calls to unmanaged COM objects.

My analysis of the use of COM in the .NET library is:

v1.0
3.4% of methods are implemented as COM interop calls, but 0.35% of
method calls in the IL methods are to COM methods.

v1.1
8% of methods are implemented as COM interop calls, but 0.42% of method
calls in the IL methods are to COM methods.

v2.0
4.2% of methods are implemented as COM interop calls, but 0.21% of
method calls in the IL methods are to COM methods.

As a comparison I have also analysed the Sept CTP of the WinFX runtime
components (6.0.5070) and I found that 2.3% of methods are implemented
as COM interop calls, but 0.2% of method calls in the IL methods are to
COM methods.

From all of this you can see that COM *is* used by the framework
library, but the usage is very low.

Richard
 
Back
Top