Talk:Association versus Dependency

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
(Confused: new section)
(Confused)
Line 3: Line 3:
 
== Confused ==
 
== Confused ==
  
I'm kind of confused with this issue, actually. Does anybody have a clear explanation on when we should use a dependency and when should use an association? Right now I tend to use a dependency only when a change in one class would affect another. If two classes only knows about each other like one calls another then I use an association. But I'm only following my hunches, does anyone knows a more decisive explanation than the one here? A Google search only contributed more to my confusion: [http://www.coderanch.com/t/100655/patterns/association-vs-dependency 1] [http://www.coderanch.com/t/97655/patterns/Dependency-vs-Association 2]
+
I'm kind of confused with this issue, actually. Does anybody have a clear explanation on when we should use a dependency and when should use an association? Right now I tend to use a dependency only when a change in one class would affect another. If two classes only knows about each other like one calls another then I use an association. But I'm only following my hunches, does anyone knows a more decisive explanation than the one here? A Google search only contributed more to my confusion: [http://www.coderanch.com/t/100655/patterns/association-vs-dependency 1] [http://www.coderanch.com/t/97655/patterns/Dependency-vs-Association 2] --[[User:Mujtaba Alshakhouri|Mujtaba Alshakhouri]] 12:27, 24 September 2010 (UTC)

Revision as of 12:27, 24 September 2010

As long as Design by contract is followed, does the difference really matter? This page needs more examples. --MartinvanZijl 03:58, 20 August 2010 (UTC)

Confused

I'm kind of confused with this issue, actually. Does anybody have a clear explanation on when we should use a dependency and when should use an association? Right now I tend to use a dependency only when a change in one class would affect another. If two classes only knows about each other like one calls another then I use an association. But I'm only following my hunches, does anyone knows a more decisive explanation than the one here? A Google search only contributed more to my confusion: 1 2 --Mujtaba Alshakhouri 12:27, 24 September 2010 (UTC)

Personal tools