Basic Architecture

The fundamental elements of COM are the following:

  • Interfaces (especially IUnknown)

  • Reference counting

  • The QueryInterface method

  • Marshaling

  • Aggregation

Let's talk about each of these separately.

Interfaces

From an object-oriented programming standpoint, and also from the perspective of COM, an interface is a mechanism for exposing functionality, as I mentioned earlier. Typically, an object uses an interface to make its capabilities available to the outside world. When an object uses an interface, the object is said to implement that interface. Users of the object can interact with the interface without knowing what the object actually is, and a single object can implement multiple interfaces.

Generally speaking, to implement an ...

Get Guru's Guide to SQL Server Architecture and Internals, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.