My experience with it has been that it's a total mess, and causes problems that are difficult to diagnose and fix for non-black-belt Windows developers.
What are the use cases that make COM shine?
My experience with it has been that it's a total mess, and causes problems that are difficult to diagnose and fix for non-black-belt Windows developers.
What are the use cases that make COM shine?
It's hard to call a product which is the backbone of one of the most popular operating systems available and the majority if it's applications anything other than useful.
COM has been replaced by .NET in many projects, but COM still can be written in lower level MFC/ATL C++, and people only use COM for writing high performance application where every cpu cycle counts, probably directX, game apps, hardware interfacing etc.
Actually, it has been in wide use since years. Many applications that integrate with each other and interact rely on COM technology. I suppose even the .NET libraries register themselves as COM.
As for the total mess, I wouldn't agree here. It's quite complex, but no mess. Naturally, you would need to have a good understanding of OO, interfaces, pointers, low level programming and that model of brain that makes a good C++ programmer.
COM provided both local (object to object) and remote (machine to machine, process to process) communications largely transparently. With a little care your code could happily work with objects hosted anywhere in the same memory space to across the internet.
While this abstraction had its problems (the dynamics of different cases were very different) and the use of a binary format challenged interoperability it did work. And work very well (consider all the line of business applications that Visual Basic enabled).
COM is still widely used in GIS applications. It is the backbone of some applications, such as ArcMap (ESRI) and their enormous programming API for Spatial Objects.
It is complex, as everyone said, but once you grasp some key concepts it easier to develop for/with it.
.NET has support for COM objects.
While not designed for it (of course) COM has incidently become the best way to interface native code (e.g. C++) with .NET.
The name COM or indeed OLE always grated with me. As I didn't view it as an Object technology - COM Objects couldn't inherit! I thought it was a packaging technology.... but M$ used the name word "Object" to make it seem more than it was.
Other technologies which were available at the same time such as NeXT's Portable Distributed Objects made it seem primitive.
What are the use cases that make COM shine?
Interop between different languages (e.g. C++ and Visual Basic)
Interop between different processes (e.g. OLE, embedding an Excel spreadsheet in a Word document)
Interop between different vendors (e.g. if you want to write a shell extension which plugs-in to Windows Explorer, you do that using COM because Explorer declares a COM interface for extensions which it's willling to invoke).
Most of the problem is because of the developer who doesn't really understand the COM. But COM is so hard to understand that Microsoft have to redesign another similar platform, that is, .Net.