Originally posted by Vishal Gupta:
Thanks Stephen,
in short
Association == "has A"
aggregation == "made up of"
Composition == "made up of and having same lifetime" or "made up of and managing lifecycle of its part"
Thanks
Thats it, however Sun uses the term "lifecycle" for composition. That is to say a composition relationship is basically an association of vital members, those, members lifecyles are directly effected by the possesing class, and cannot exist without it (but they also are not neccessarily aware of the parent class). For example a Book(class) "has pages" but it is also "composed of pages" those pages (page classes for example), do not know what book they are in, but destroy the book, and all the pages are also destroyed. Or a Body class may have many organ classes or types, but kill the body and all the organs die!