C++ : Association, Aggregation and Composition
I'm beginning to study OOAD and I'm having difficulty finding a C++ code example that'd illustrate how Association , Aggregation and Composition are implemented programmatically. (There are several posts everywhere but they relate to C# or java). I did find an example or two, but they all conflict with my instructor's instructions and I'm confused. My understanding is that in: Association: Foo has a pointer to Bar object as a data member Aggregation: Foo has a pointer to Bar object and data of Bar is deep copied in that pointer. Composition: Foo has a Bar object as data member. And this is how