Talk:Association versus Dependency

From CSSEMediaWiki
(Difference between revisions)
Jump to: navigation, search
(Added thought about DBC.)
 
(Confused: new section)
Line 1: Line 1:
 
As long as [[Design by contract]] is followed, does the difference really matter? This page needs more examples. --[[User:MartinvanZijl|MartinvanZijl]] 03:58, 20 August 2010 (UTC)
 
As long as [[Design by contract]] is followed, does the difference really matter? This page needs more examples. --[[User:MartinvanZijl|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: [http://www.coderanch.com/t/100655/patterns/association-vs-dependency 1] [http://www.coderanch.com/t/97655/patterns/Dependency-vs-Association 2]

Revision as of 12:23, 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

Personal tools