tags:

views:

214

answers:

3

In a UML class diagram, what is the difference between an association relationship and a dependancy relationship?

From what I know, an association is a stronger relationship than a dependancy, but I'm not sure how it is stronger.

Any example would be more than welcome :)

+1  A: 

What is the difference between dependency and association?

Mitch Wheat
Why answer, when Martin does it so much better for you?! +1
Randolpho
A: 

An association almost always implies that one object has the other object as a field/property/attribute (terminology differs). A dependency typically (but not always) implies that an object accepts another object as a method parameter, instantiates, or uses another object. A dependency is very much implied by an association.

Randolpho
A: 

A dependency is very general and lowering complexity is about diminishing dependencies as much as possible.

An association is a strong (static) dependency. Aggregation and Composition are even stronger.

programmernovice