as in <pre> composition / \ / \ / \ / \ / \ aggregation association </pre> is it something as simple as class A{} class B{ public A a = new A(); } or is it something deeper than that ?
(my appologies, I'm assuming this thread is going to be moved )
aadhi agathi
Ranch Hand
Joined: Apr 29, 2002
Posts: 263
posted
0
Originally posted by Mohanlal Karamchand: as in <pre> composition / \ / \ / \ / \ / \ aggregation association </pre> is it something as simple as class A{} class B{ public A a = new A(); } or is it something deeper than that ?
association / \ / \ / \ / \ / \ aggregation composition this seems more logical
also check out dependency( Class A calling a method of class B). Please check out the UML version 5. i like it except the word "semantic" [everthing is hiddedn under it]
Aadhi
Ellen Zhao
Ranch Hand
Joined: Sep 17, 2002
Posts: 581
posted
0
My humble opinion, if the relationship between the two classes is not inheritance not aggregation not dependency, which are relatively easier to decide, then you may well relate the classes as association. For instance, traffic lights and cars, traffic lights conduct cars, association. Street traffic system aggregates both of the traffic lights class and cars class ( and many more ). Does that make sense?
Regards, Ellen
Jason Menard
Sheriff
Joined: Nov 09, 2000
Posts: 6450
posted
0
I'm going to move this to the OO forum, as this discussion is far too meaningful for MD.
Originally posted by Mohanlal Karamchand: as in <pre> composition / \ / \ / \ / \ / \ aggregation association </pre>
Sorry, I don't think I do understand this diagram...
is it something as simple as class A{} class B{ public A a = new A(); } or is it something deeper than that ?
This may well be a valid implementation of an association relationship between B and A (it may also be an aggregation or even composition - it can't be decided from this code snippet). The semantic of an association from B to A is that instances of B may send messages to (call methods of) instances of class A. Notice that for this, B doesn't need to have a field of type A. This may change in UML 2.0.
The soul is dyed the color of its thoughts. Think only on those things that are in line with your principles and can bear the light of day. The content of your character is your choice. Day by day, what you do is who you become. Your integrity is your destiny - it is the light that guides your way. - Heraclitus
Sahir Shibley
Ranch Hand
Joined: Apr 08, 2000
Posts: 275
posted
0
I think he means that aggregation and association are two kinds of Composition. Mr. Karamchand, I noticed that this thread was moved here from MD. What is the objective of this question ? And why are you using a fake name in the OOP forum ?
Ilja Preuss
author
Sheriff
Joined: Jul 11, 2001
Posts: 14112
posted
0
Originally posted by Sahir Shibley: I think he means that aggregation and association are two kinds of Composition.
Then he is wrong - composition is a special kind of aggregation, which is a special kind of an association.
Sahir Shibley
Ranch Hand
Joined: Apr 08, 2000
Posts: 275
posted
0
He seems to have been influenced by Kafura. http://people.cs.vt.edu/~kafura/cs2704/aggregation.concept.html Kafura goes on to say "An association among objects is created when an object contains references or pointers to other objects." That statement seems to imply that association is a relationship between the class and it's public data member ???
Kafura goes on to say "An association among objects is created when an object contains references or pointers to other objects."
That's bogus - there are no associations between objects, only links (which are instances of associations). I think the reference above explains very well what an association is.