Let's say I have the following relationship:
class A {
public:
A(B& _objB);
B& objB;
};
A::A(B& _objB)
: objB(_objB) {}
This does not seem to match my understanding of the UML definitions of aggregation or composition. This is similar to composition, but in the composition, the lifetime of its object must be tied to the parent object. In this case, objB exists before the creation of A and after the destruction of A. A cannot live without B, but B can live without A. This is the opposite of the standard composition relationships. Does it make it an aggregate or something else?
source
share