Advertisement
Beginner C# Programming, .NET Framework Fundamentals

What is COM and what are the disadvantages of COM?

Short answer

COM, or Component Object Model, is an older Microsoft technology that allows software components to communicate with each other regardless of the programming language they were written in, mainly used before dot NET existed.

Save C# Programming mock interview
Advertisement
AModel answer
COM, or Component Object Model, is an older Microsoft technology that allows software components to communicate with each other regardless of the programming language they were written in, mainly used before dot NET existed. Its main disadvantages include complex registration requirements in the Windows registry, poor memory management since developers had to manually manage reference counting, lack of true cross platform support, and difficulty maintaining version compatibility, all of which dot NET was designed to solve with its managed runtime and simpler component model.
// COM required manual reference counting in older languages
// dot NET replaced this with automatic garbage collection
var obj = new MyManagedClass(); // no manual release needed
Real-world example
A legacy Windows desktop application built with COM components struggled with registration issues whenever it was deployed to a new machine, which was a major reason the company eventually rewrote it using dot NET.
Likely follow-ups
  • Why did Microsoft create dot NET instead of continuing to improve COM?
  • Can dot NET applications still interact with COM components?
Related topics