Hi Mike, Just would like add some comment on the examples given above: - In aggregation relationship, the ‘part’ object reference can be re-used & creation of ‘part’ object is not the responsibility of the ‘whole‘object usully. It would have been created somewhere else, and passed to the ‘whole’ object as a method argument. - In composition, the life cycle of the ‘part’ is controlled by the ‘whole’. So, if I am right then your pseudo code examples would need to get swapped within each other. ie. SparkPlug/Car example shows composition & Room/building example shows aggregation. Waiting for your response.... Thanks in advance, Mohit
|