I noticed that numerous books, etc. COM indicates that it is relatively easy to implement an object that can be used as an internal object in COM aggregation. However, if I am missing something, it seems that aggregation can only be successful in extremely limited scenarios, and therefore support for it should only be provided when such a scenario is definitely recognized.
The part that bothers me is this. COM aggregation combines the identifier of an internal object and an external object. The developer of the external object selects a subset of the interfaces of the internal objects and forwards requests for these interfaces to the internal object. The internal object forwards all requests for interfaces to the external object. Now suppose that an internal object, as part of its implementation, constructs child COM objects. Presumably, the interface pointer is passed to this COM object so that it can communicate with its parent. An internal object has some idea of ββthe interfaces that it implements. However, the external entity may have decided not to forward some of these interfaces. In fact, the documentation states that an external entity should not blindly forward interfaces. This, apparently, means that the internal object often cannot pass interface pointers to other COM objects, unless the external object is required to forward all of these interfaces to the internal object. This is not limited to the script of child objects. Indeed, at any place where the implementation of an internal object passes an interface pointer, it looks like they might be affected.
So, it seems that aggregation is not a common goal, because - in cases where the internal object must interact with other COM objects - it makes strict demands on the external object as to which interfaces should be minimally redirected and no more interfaces can be added to this list in future versions of the internal object without compromising compatibility with existing external objects that do not forward these interfaces.
Is this a correct (and rarely documented) description of how things actually exist or are there more in history?
source share