tags:

views:

201

answers:

9

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?

+6  A: 

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.

JaredPar
It allowed computers to help users => it was useful.
Richard
A: 

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.

Akash Kava
Not really true. The .NET runtime (CLI) *is a COM component*, the default startup code added by the compiler into .exe assemblies hides this, but if you want to host .NET yourself you need to talk COM.
Richard
COM and CLI are different things, you can use .net assembly as COM only if you set it to use it as COM, yes COM and CLI has some bridge but since its transparent to users, people think that they are same. COM itself was as powerful as CLI, and it was multi language compatible itself, but it could not serve for mass development because its runtime was c based and required too much coding.
Akash Kava
+3  A: 

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.

Developer Art
I think anything complicated enough is a mess for person, who does not understand it/is not willing to spend some time understanding it.
Ula Krukar
I nevered used Visual Basic and Delphi, but I heard that their in-compiler support for COM was supposed to make it easy for their users to consume COM objects.
ChrisW
+6  A: 

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).

Richard
Standards are good, even if they aren't good standards.
Will Shaver
well stated (both of you)
Hardryv
A: 

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.

George
A: 

While not designed for it (of course) COM has incidently become the best way to interface native code (e.g. C++) with .NET.

Peter Mortensen
A: 

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.

Tony Lambert
+1  A: 

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).

ChrisW
+1 And don't forget interop between unmanaged C++ and .NET - each side can be a COM server depending on what you want to do.
sharptooth
A: 

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.

lovespring