Summary
In this chapter, we have pressed forward with our pursuit of object-oriented programming by exploring various object relationships – association, aggregation, and composition. We have understood the various OO design concepts representing these relationships and have seen that C++ does not offer direct language support through keywords or specific language features to implement these concepts.
Nonetheless, we have learned several techniques for implementing these core OO relationships, such as embedded objects for composition and generalized aggregation, or using pointers to implement association. We have looked at the typical longevity of object existence with these relationships; for example, with aggregation, by creating and destroying its inner part (through an embedded object, or more rarely, by allocating and deallocating a pointer member). Or through the independent existence of associated objects that neither create nor destroy one another. We have also looked...