Changes between Version 2 and Version 3 of Standards/CompositionVersusAggregation
- Timestamp:
- 05/28/08 04:41:02 (5 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Standards/CompositionVersusAggregation
v1 v3 2 2 3 3 When trying to understand the relationships between objects, the discussion of aggregretation versus composition always comes up. For completeness, a third relationship should be mentioned, association. By far the best discussion of this topic can be found [http://www.patternscentral.com/modules.php?name=Sections&op=viewarticle&artid=8&page=2 here]. The conclusion reached by the author is as follows: 4 5 COMPOSITION: If destroying the whole destroys (or renders meaningless) the parts, then we have a composition.6 4 7 AGGREGATION: If destroying the components destroys (or renders meaningless) the whole, then we have an aggregation. 5 6 '''COMPOSITION''': If destroying the whole destroys (or renders meaningless) the parts, then we have a composition. 7 8 '''AGGREGATION''': If destroying the components destroys (or renders meaningless) the whole, then we have an aggregation. 8 9 9 10 Composition EXAMPLE:
