OOPortal OOPortal


Containment Delegation  «Prev  Next»
Lesson 7 COM's reusability mechanisms
Objective Establish reuse terminology.

Establish Reuse Terminology in COM

COM's Reusability Mechanisms

So far, we have determined that:
  1. Software components integrate at the binary level.
  2. Software component reuse is based on object composition.

Having surveyed the difference between source-level reuse and integration as used in C++, and binary-level integration and reuse as used by software components, let's move on to COM's reuse mechanisms.
For our study of COM's reuse mechanisms. let's set up a scenario and some terminology:
  1. We have a COM client called COMCli.
  2. We have a COM object, used by COMCli, called OuterCOMObj.
  3. We also have a COM object called InnerCOMObj that is reused by OuterCOMObj.

The following illustration depicts the relationship between COM client COMCli and both COM objects, OuterCOMObj and InnerCOMObj.
Relationship between COMCli, OuterCOMObj, and InnerCOMObj

In our discussions, OuterCOMObj will be called the "outer COM object" and InnerCOMObj will be called the "inner COM object". For now, do not worry about the COM servers that contain each object. Also, do not be misled by the names of each object. The client is not aware that OuterCOMObj is reusing InnerCOMObj.
COM supports two basic reuse mechanisms: containment/delegation and aggregation. We will discuss containment/delegation throughout the remainder of this module. We will discuss aggregation in the next module.