next up previous contents index
Next: 4.1.2 Querying for Interfaces Up: 4.1 Objects and Interfaces Previous: 4.1 Objects and Interfaces

4.1.1 Interface Inheritance and the IUnknown Interface

COM interfaces can directly extend other COM interfaces in single-inheritance relationships, simply by adding additional methods to the dispatch table defined by the base interface and/or further restricting the semantic requirements defined by the base interface. (Derived interfaces cannot relax or weaken the requirements of the base interface, since that would violate the whole principle of subtyping.) Multiple inheritance of COM interfaces cannot be implemented simply by extending dispatch tables this way, since in this case there would be multiple mutually conflicting dispatch tables to extend; however, the effect of multiple inheritance can be achieved by making the object support multiple independent interfaces using the querying mechanism described below. Note that the only form of inheritance of relevance to COM is subtyping, or inheritance of interfaces (types), as opposed to subclassing, or implementation inheritance: COM doesn't care how an object is implemented, only what interfaces it exports.

Ultimately, every COM interface is derived from a single standard universal base interface, known as IUnknown in the COM standard and oskit_iunknown in the OSKit headers. This minimal COM interface contains only three standard methods, query, addref, and release, which provide the basic administrative facilities that all COM objects are expected to implement. These basic facilities, which essentially provide run-time type determination and reference counting, are described in the following sections.



University of Utah Flux Research Group