Suppose a class Car which always creates the same object except that the Car objects can each one have a different motor inside them.
Is it composition because when a Car object is destroyed, its motor is also destroyed?
Or is it aggregation because the same type of motor could be inside different car objects?
I guess where I'm confused is in deciding whether some class is a composition or an aggregation. If you base your decision on whether a component is destroyed when its object is destroyed, what is a component? Is a component the concrete instance of a motor which was specifically created for a Car, or is it the motor class in general? In the first case, I want to say that it's composition, in the second, I want to say that it's aggregation.
I'm sorry I can't post code details, I'm not allowed to. I just want to have an abstract answer.