COM – Component Object Model

COM or Component Object Model, is a technology that’s part of Microsoft Windows.  It’s purpose is to allow objects (as in Object Oriented Programming) to be shared among any programs running on the computer on which they’re installed.  They’re a specialized type of DLL.

image COM is also referred to as “ActiveX”.  Internet Explorer add-ins are ActiveX components, which means they’re COM components.

The idea is to be able to write an object in any computer language, install it on the machine, and allow any other program, written in any other language, to make use of it.  COM components provide just about any kind of functionality imaginable.  There are COM components to let your program store and retrieve data from databases, to get the current weather from remote servers over the internet, to play music on your computer, to control external hardware… even to control robots.

This works to a certain level, but not all technologies can make full use of all of the capabilities of the COM specifications.  Additionally, there are severe problems with versioning.  In other words, when someone writes a program that expects a particular version of a COM component to be installed on the machine, but some other program installed a newer version of it (or worse yet, an older version of it), it can break the program(s) that expect(s) another version.  There are many times where it’s not possible for all programs that need a particular COM component to be able to all work, because they all expect a specific (and different) version and will fail if the one they need is not present.  This is not a fault of the programs that expect a particular version.  Sometimes the different versions of the COM component are different enough that no programs written for one version can possibly work with another version.

That versioning problem, along with many programs insisting on installing a particular version (which overwrites the one that was already installed) is a very unpopular concept dubbed “DLL Hell”.

Microsoft has come up with a newer technology that resolves the problem of having only ONE version of a DLL COM Component installed, yet still be shared among different programs.  That was resolved with the release of Microsoft .NET v1.0.  It doesn’t fix the prior COM components or any programs that rely on any COM components, nor does it prevent software providers from still writing old COM component technology.  It’s a technology that’s newer than COM and is an alternative to COM.  Programs must be written to use the new technology to take advantage of it.  With .NET, multiple versions of DLLs can reside on a machine at the same time and still be shared among different programs.  For a .NET DLL to be shared on a machine, it must be installed in what’s called the GAC (pronounced “gak”, “Globally Assembly Cache”).  Programs that use GAC objects can request to use a specific version, any version, or have a preference for a specific version, but still work if another is available, but the requested version isn’t.

Even though .NET is a newer technology that resolves a lot of the problems with COM and even though .NET has been around since February 2002, it doesn’t mean that COM is dead.  In fact, there are probably just as many new COM components coming out every day as there are .NET components.  Internet Explorer still supports ActiveX as the plug-in model.  COM may be antiquated, but that’s not stopping some software vendors from still creating new stuff with that technology, unfortunately.