Aggregation: the object exists outside the other, is created outside, so it is passed as an argument (for example) to the construtor. Ex: People – car. The car is create in a different context and than becomes a person property.
Composition: the object only exists, or only makes sense inside the other, as a part of the other. Ex: People – heart. You don’t create a heart and then pass it to a person.
Does this mean with DI frameworks, aggregation is the preferred and more common approach, and improves testability?
Does this also mean the lack of multiple inheritance in a language like C# can be mitigated through the use of aggregation. I have always heard the discussion framed in terms of "composition versus inheritance". Is there a reason for this?