In one of his talks, Uncle Bob describes Software Engineering as the art of managing dependencies. This is something that a lot of new programmers have difficulty with. I often run into code written by beginners (and some not-so-beginnners) that has lots of circular dependencies. I also see a lot of questions on the forums about dependency management, such as this post. Often the questions are not directly about dependencies as beginners tend not to be very aware of dependency issues. Instead, the questions are usually about the symptoms of poor dependency management.
To me the key reason for dependency management is reusability. If a module is not dependant on anything or has minimal dependencies that make sense, then it is easy to drag it off into another project. Some added benefits that come along for the ride are: improved testability and improved stability. Testability improves because the decoupling makes it easier to isolate what you are testing. Stability is improved because every dependency adds instability, so having fewer dependencies means more stability.
Here is a little video I put together on the very basics of dependency management with DQMH. I’ve got a couple more posts on the schedule early next year to dive into this a little more.
If you want to learn more about the DQMH in general, sign up for our next class.