Containment Delegation  «Prev  Next»
Lesson 10

Reusability, Containment and Delegation using COM Conclusion

This module discussed the following topics.
  1. The difference between reusing a C++ class at the source level and a component at the binary level.
  2. Reusing COM objects via containment/delegation. This technique involves having the outer COM object act as a client to the inner COM object. The outer COM object mirrors interfaces implemented in the inner COM object and forwards calls into the inner COM object. The inner COM object is not aware that it is being reused. The client is not aware of the inner COM object.
We will study COM's other reuse mechanism, aggregation in the next module.

Key terms and concepts

The following key terms and concepts were introduced in this module:
  1. Aggregation:Aggregation provides a mechanism that allows you to compose several COM objects into one larger composite COM object. Aggregated objects combine with the outer COM object (the aggregator) into what appears to be one COM object that supports the interfaces implemented in all the objects.
  2. Binary-level integration:Software components do not support inheritance. Instead, one component has code in it that accesses and uses the services of another component.
  3. C++ reusability
  4. Call delegation:In containment/delegation when an outer COM object receives a call in an interface it mirrors from the inner COM object - the outer COM object calls into the inner COM object's methods.
  5. Containment/delegation
  6. Immutable:COM interfaces are immutable. Once a COM interface is published or distributed its IID and methods can not change.
  7. Inner COM object
  8. Outer COM object
  9. Object composition:The combination of two or more software components into a combined unit that acts like one component.
  10. Reusability:C++ supports reuse of implementation through inheritance and templates. C++ also supports specification through inheritance of abstract base classes.
  11. Software component:An independent module that provides services through interfaces. Software components integrate at the binary level.
  12. Source-code based dependencies:One or more source files that are needed to integrate an object into a program. Generally, this means that you must compile the definition of a module into your code. For example - to use a C++ class, an include file with the class definition is needed.
Do you have any questions or comments about reusability, containment/delegation, or any of the other material covered so far in this course?