Eliminating Static Dependencies

Nature abhors a vacuum.  It turns out she also abhors static dependencies (I have my sources).  Static dependencies are the modern-day globals, often exposed through classes named “Helper”.  I’ve certainly been guilty of overusing static dependencies in the past, with classes like “LoggingHelper”, “SessionHelper”, “DBHelper” and so on. The problem with static dependencies is that they are opaque to the extreme, enforcing a strong coupling that is impossible to see from users of the class.  To demonstrate techniques for eliminating static dependencies, Ray Houston and Jimmy Bogard created a short screencast. The screencast demonstrates using TDD along with ideas and techniques laid out in Michael Feathers’ Working Effectively with Legacy Code and Joshua Kerievsky’s Refactoring to Patterns.  It details how to make safe, responsible changes to an existing legacy codebase, while improving the design by breaking out dependencies to a static class.

Watch this screencast on Pablo TV

Related Videos: