A bit of background: As a team lead I use NDepend about once a week to check for the quality of our code. Especially the test-coverage, lines of code and cyclomatic complexity metrics are invaluable for me. But when it comes down to levelization and dependency cycles I am a bit ... well concerned. Patrick Smacchia has a nice blog post which describes the goal of levelization.
To be clear: Under "dependency cycle" I understand a circular references between two namespaces.
Currently I am working on a Windows CE based GUI framework for embedded instruments - just think of the Android graphics platform but for very low end instruments. The framework is a single assembly with about 50.000 lines of code (tests excluded). The framework is split into the following namespaces:
- Core Navigation & Menu Subsystem
- Screen Subsystem (Presenters / Views / ...)
- Controls / Widget Layer
Today I spent the half day on trying to bringe the code to proper levels [thanks to Resharper no problem in general] but in all the cases some dependency cycles exist.
So my question: How strictly do you follow the "No Dependency Cycle" rule? Is levelization really that important?