|
It always bothers me to see mock objects creating and
returning other mock objects.
David Chelimsky on Dependencies
David Chelimsky
of Object Mentor
notes
that dependency injection eases the pain of dependencies so much that
we sometimes don’t bother to root out the bad dependencies. Read
the
article
and pay close attention to the dependencies in the original and final
versions (I drew a couple UML diagrams to keep it clear in my head).
Plus its got a great Princess
Bride
reference!
|