Saturday, June 16, 2012

dependency vs association


Dependency is normally created when you receive a reference to a class as part of a particular operation / method.
Dependency indicates that you may invoke one of the APIs of the received class reference and any modification to that class may break your class as well.
Dependency is represented by a dashed arrow starting from the dependent class to its dependency.
Multiplicity normally doesn’t make sense on a Dependency.

http://nirajrules.wordpress.com/2011/07/15/association-vs-dependency-vs-aggregation-vs-composition/

One class depends on another if the latter is a parameter variable or local variable of a method of the former.
This is different from an association, where an attribute of the former is an instance of the latter.

http://en.wikipedia.org/wiki/Class_diagram#Analysis_stereotypes

No comments:

Post a Comment