|
|
|
The Component
Object Model (COM) is a way for software components to communicate with each
other. It's a binary and network standard that allows any two components to
communicate regardless of what machine they're running on (as long as the
machines are connected), what operating systems the machines are running (as
long as it supports COM), and what language the components are written in.
COM further provides location transparency: it doesn't matter to you when you
write your components whether the other components are in-process DLLs, local
EXEs, or components located on some other machine.
|
|
COM is based on
objects—but the objects aren't quite the objects you're used to in C++ or
Visual Basic. An object is the impelementation of a single class at
runtime.Acomponent is a compiled piece of code based on the aggregation of
many classes. To sum it up a component is some piece of compiled code that
provides some service to the rest of the system.
|
|
First off, COM
objects are well encapsulated. You cannot gain access to the internal
implementation of the object; you have no way of knowing what data structures
the object might be using. In fact, the objects are so well encapsulated that
COM objects are usually just drawn as boxes.
|
|
COM has its
roots in OLE version 1, which was created in 1991 and was a proprietary
document integration and management framework for the Microsoft Office suite.
Microsoft later realized that document integration is just a special case of
component integration. OLE version 2, released in 1995 was a major
enhancement over its predecessor. The foundation of OLE version 2, now called
COM, provided a general-purpose mechanism for component integration on
Windows platforms
|