Folks I am doing my partII assignment and having a tough time trying to distinguish if a relationship is either a dependency or association. I know the definitions, any insights or rules of thumb that I can use from a practical perspective??? Eric
Victor Htet
Ranch Hand
Joined: Apr 09, 2000
Posts: 70
posted
0
Eric, Association is stronger than dependency. Association can be further specified as extends, implements, aggregation relationships. From programming point of view, if you use class A as a paramater of a method or return type of a method in class B, then class B has dependency relationship with class A. Victor SCJP, SCWCD, SCEA
SCJP,SCWCD,SCEA,SCDJWS
Eric Lefurge
Greenhorn
Joined: Dec 05, 2001
Posts: 17
posted
0
Victor On the same note, say a class A instantiates Class B and calls its methods, then its an association ??
-@RIC
Rufus BugleWeed
Ranch Hand
Joined: Feb 22, 2002
Posts: 1551
posted
0
That could be stronger than association. It might be aggregation or composition. The experts disagree about what's what.
Victor Htet
Ranch Hand
Joined: Apr 09, 2000
Posts: 70
posted
0
Eric, Don't think too deep. I mean don't think at very detailed level. If you want to think in detail, do it with the following perspectives: 1) does class A hold class B as member variable? 2) does class A extends class B 3) does class A implements interface C 4) does class A's methods depend on class B or does changes to class B reflect class A behavior?
I highly suggest you design your system not in very detail level.
Eric Lefurge
Greenhorn
Joined: Dec 05, 2001
Posts: 17
posted
0
Victor , Rufus Thanks for ur suggestions. One more clarification, So does it imply that relationships are implementation dependant and varies from each person who designed the application??? eRIC
Victor Htet
Ranch Hand
Joined: Apr 09, 2000
Posts: 70
posted
0
Eric, No. Your design should be as less implementation dependent as possible. But for assignment, you can stick to J2EE implementation perspective. Yes. It varies from each person who designed the application??? Every design is unique for each architect.
Sanjay Raghavan<br />SCJP2, SCEA-J2EE<br />Moderator - <a href="http://groups.yahoo.com/group/scea_prep" target="_blank" rel="nofollow">SCEA PREP</a><br />Co-Author - <a href="http://www.whizlabs.com/scea/scea.html" target="_blank" rel="nofollow">SCEA@Whiz</a><br /><i>Where did you sip your Java Today?</i>
Rufus BugleWeed
Ranch Hand
Joined: Feb 22, 2002
Posts: 1551
posted
0
A UML diagram is implemetatin dependent. UML Modeling is like speaking a language. It's a new language and different speakers do things different ways.
Peter Coad gave an example of aggregation as the relationship between an organization and its clerks; Jim Rumbaugh stated that a company is not an aggregation of its employees. When gurus can't agree what are we to do?
from UML Distilled by Addison-Wesley
Eric Lefurge
Greenhorn
Joined: Dec 05, 2001
Posts: 17
posted
0
Thanks for ur insight folks, if was very helpfull. Now I feel like I am relationships expert, jus kidding. eRIC