1

I'm learning COM and after reading Essential COM I find this idea brilliant and still applicable to a wide range of scenarios where cross vendor compatibility and backward compatibility matters.However I do not find many resources online about COM, nor are many people still talking about it.

Is this COM technology out-of-date? And if so, what are some of solutions more trendy than COM to address cross vendor compiling compatibility and backward compatibility issues at binary level?

Vince
  • 81
  • 4
  • 1
    .NET was intended to be the modern replacement for COM. You can still find this evident in a number of places where COMPLUS is used as part of code names. E.g. [this search](https://github.com/dotnet/coreclr/search?q=complus&unscoped_q=complus) of the Core CLR github. – Damien_The_Unbeliever Oct 01 '18 at 05:47
  • Some answers here: https://stackoverflow.com/questions/20215438/com-in-the-non-windows-world – Simon Mourier Oct 01 '18 at 06:35

1 Answers1

1

COM is not that popular with .NET because the Global Assembly Cache (GAC) and the internal manifests built in to .net assemblies solves the same purpose that COM registration does.

Here is a useful article that might help explain it, here is a snippit from it

.NET provides a completely new approach to creating and deploying components, which are also known as assemblies. With COM, the developer has to register the component on the server -- i.e, its information had to be updated in the system registry. The purpose is to keep the information of the components in a central location so that COM+ can find the appropriate component.

With .NET assemblies, the assembly file encapsulates all the meta data required in special sections called manifests. [...] Since the information about the component is kept in manifests, the developer doesn't have to register the component on the server, and several versions of the same component can safely co-exist together on the same machine.

The article does not actually mention the GAC, but any cross vendor interaction or binary backwards compatibility you would do with COM can be handled in .NET by the vender registering the assembly in the GAC and your program using that assembly.

The only time .NET uses COM is when interoperating with unmanaged code that was written originally for COM.

However, many vendors don't even use the GAC today either, what they will do is ship a assembly that the programmer can add to the project and deploy with the exe, typically using NuGet to distribute it.

Scott Chamberlain
  • 124,994
  • 33
  • 282
  • 431
  • COM is "just" a binary contract (the vtable), the IUnknown definition, plus some simple rules. Registration is an auxiliary optional service. COM is still used everywhere in Windows. – Simon Mourier Oct 01 '18 at 06:35
  • @SimonMourier I totally agree with you. Windows is mostly made up of non managed assemblies, and that is where COM is still commonly used today. But .NET assembly to .NET assembly service interactions does not need to use it. – Scott Chamberlain Oct 02 '18 at 00:27