Association is the ability to send messages from one instance to another. Aggregation is a part-whole relationship and is exactly the same as association except it doesn't allow a part to contain its whole. Composition is exactly like aggregation except that the lifetime of the 'part' is controlled by the 'whole'.
Understanding Association, Aggregate, and Composition
GuoLuke2 (2009-04-15 09:28:34) 评论 (0)Association is the ability to send messages from one instance to another. Aggregation is a part-whole relationship and is exactly the same as association except it doesn't allow a part to contain its whole. Composition is exactly like aggregation except that the lifetime of the 'part' is controlled by the 'whole'.