|
|
Re: Composition and aggregation implementation stratagy
|
Posted: Jun 1, 2006 7:52 PM
|
|
> Programmatically there is no difference between > composition, aggregation and association in languages like > Java, where the garbage collection is automatic. > > Vijay Nathani, > www.geocities.com/vijay_nathani
Not exactly. That's true for immutable objects (like String), but composition is similar to ownership, so it can be very important that other objects aren't modifying an object that is owned by another.
Association, aggregation, and composition may all be directly coded using fields (1..1 and 0..1) or collections (m..n), but the way they should be treated elsewhere in code very differently.
|
|