This module discussed the following topics.
- The difference between reusing a C++ class at the source level and a component at the binary level.
- 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.
The following key terms and concepts were introduced in this module:
- 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.
- 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.
- C++ reusability
- 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.
- Immutable:COM interfaces are immutable. Once a COM interface is published or distributed its IID and methods can not change.
- Inner COM object
- Outer COM object
- Object composition:The combination of two or more software components into a combined unit that acts like one component.
- Reusability:C++ supports reuse of implementation through inheritance and templates. C++ also supports specification through inheritance of abstract base classes.
- Software component:An independent module that provides services through interfaces. Software components integrate at the binary level.
- 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?