Mikey Alleblas

Greenhorn
+ Follow
since Jun 25, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Mikey Alleblas

The way it seems to work to me is that an aggregation is purely conceptual. An Association links two classes which can be thought to be on the same level. In aggregation, it is just an association which identifies that the whole part (where the diamond is) is constituted of the parts (the other end) and this is how they associate. In programming this relationship, it doesn't seem much different to an association. I think an aggregation is redundant.

A good explanation from the book:
"The meaning of this simple form of aggregation is entirely conceptual. The open diamond distinguishes the 'whole' from the 'part', no more, no less. This means that simple aggregation does not change the meaning of navigation across the association between the whole and its parts, nor does it link the lifetimes of the whole and its parts."

A composition on the other hand is a strong association between the whole and its parts. When the whole class terminates, so do its parts. I think this wuold relate to programming as the instances of the "parts" classes being created within the "whole" object itself.
The book I got doesn't have composition in the part of the book where I got the defition for the aggregate.

A good explanation from the book:
"... in a composite aggreation, the whole is responsible for the disposition of its parts, which means that the composite must manage the creation and destruction of its parts. For example, when you create a 'Frame' in a windowing system, yuo must attach it to an enclosing 'Window'. Similarly, when you destroy the 'Window', the 'Window' object must in turn destroy its 'Frame' parts."

As for simple association, the book says:
"Use associations when yuo want to show structural relationships."
As for applications in code, I got no idea.

Do not take this information as being entirely correct, I am only learning it myself however I feel that I got it right since I was copying from the book .

-Mikey

Ps: The book I got for the curious is
The Unified Modeling Language User Guide
by
Grady Booch, James Rumbaugh and Ivar Jacobson
ISBN 0-201-57168-4
Was printed on recycled paper.

http://www.aw-bc.com/catalog/academic/product/0,1144,0201571684,00.html
http://www.amazon.com/exec/obidos/tg/detail/-/0201571684/qid=1088208988/sr=8-1/ref=sr_8_xs_ap_i1_xgl14/102-7321209-0560162?v=glance&s=books&n=507846

I first tried SAMS learn UML in 24 hours and do not recommend it at all. It is I feel, better suited for management who have no idea about UML and have no need to get in too deep, but want to get a basic understanding of proposed systems and such which have been modelled in the UML.

Other books worth considering
http://www.amazon.com/exec/obidos/tg/detail/-/0596003447/qid=1088208961/sr=8-2/ref=pd_ka_2/102-7321209-0560162?v=glance&s=books&n=507846
I never read it, but O'Reilly books have always been my favourite technical reference and preferred reading material of any sort for that matter.