COM Fundamentals

2. Interfaces

In COM, applications interact with each other and with the system through collections of functions called interfaces.


Attributes of interfaces

Given that an interface is a contractual way for a component object to expose its services, there are four very important points to understand:

It is convenient to adopt a standard pictorial representation for objects and their interfaces. The adopted convention is to draw each interface on an object as a "plug-in jack."


Figure 1. A typical picture of a component object that supports three interfaces A, B, and C.

Figure 2. Interfaces extend toward the clients connected to them.

Figure 3. Two applications may connect to each other's objects, in which case they extend their interfaces toward each other.

The unique use of interfaces in COM provides five major benefits:

  1. The ability for functionality in applications (clients or servers of objects) to evolve over time. This is accomplished through a request called QueryInterface that absolutely all COM objects support (or else they are not COM objects).
  2. Fast and simple object interaction.
  3. Interface reuse.
  4. "Local/Remote Transparency."
  5. Programming language independence.

กก