Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is a current analog of COM technology?

Tags:

c#

.net

wpf

com

COM technology seems a little outdated already, though still in use. But what approach is recommended now for implementing the same kind of interoperability when building a .NET app, specifically, in WPF?

I.e. what is a modern replacement of a COM object?

like image 539
rem Avatar asked Sep 30 '10 13:09

rem


2 Answers

.NET was very much intended to be the replacement for COM. The project had many names while it was being worked on, but it started life as "COM+". This influence is still evident in many places. Many of the core source code files for the CLR start with the name "com", even though the CLR uses (almost) no COM at all. The Windows exception code for a managed exception is 0xE0434F4D. The last 3 byte values of the code is ASCII for "COM".

The assertion that WCF was a replacement is not accurate. It replaced .NET Remoting. COM has a very wide range, it is a generic interop tool, much like the CLR allows many languages to interoperate. One of its features was supporting interop between different processes and machines, perhaps the source of the statement. But that's just a part of it.

There are still lots of COM applications that have not been replaced by .NET. The best example is the Windows shell, Explorer.exe. Pretty hard to do something as simple as creating a context menu shell extension in C#. And until .NET 4.0 strongly discouraged.

like image 145
Hans Passant Avatar answered Oct 06 '22 11:10

Hans Passant


In a general sense, .NET itself is the replacement for COM, and the replacement for a COM object is a .NET assembly. See for example the highly suggestive chapter title of this early .NET book by Don Box and Chris Sells (who one can be pretty sure know what they're talking about...)

like image 31
AakashM Avatar answered Oct 06 '22 12:10

AakashM