Friday, February 24, 2006

Rip out those dependencies

Theres not much more more frustrating than going into some code to make what should be a quick change only to discover that half of the world depends on the code you're going to change and subsequently everything breaks.

This is especially irritating when you discover there is no need for this and it has been done for *convenience*.

Reducing dependencies is a major part of stopping codebase entropy and needs to be considered whenever you encounter this situation.

There are some tools that can really assist in figuring out these dependencies. Lutz Roeders excellent Reflector has an analyse facility that works like the callers graph in Visual Studio but for both upstream and downstream dependencies.

ANother useful tool is NDepend which analyses a whole assembly to provide inter-assembly dependencies.

1 comment:

Anonymous said...

Reflector's analyzer actually does inner-assembly dependencies as well. You can point it at a namespace or type and it will show you what other stuff it depends on and or where it is used elsewhere.