Saturday, April 4, 2009

AutoDiagrammer and Dependency Structure Matrix addins for Reflector


Reflector is a great tool for any .NET developer. However you can make it even better with addins. Today I got two of them for you. Without further delay our first reviewee is...



AutoDiagrammer














This plugin allows you to build class diagrams within your Reflection thus source code isn't necessary at all. Its has bunch of options like show/hide interfaces, supports zooming in and out, printing and saving in different image formats.

Lightweight and easy to use this tool might come in handy.



Dependency Structure Matrix plugin


Dependency Structure Matrix (DSM) allows you to get an insight about connections between your modules in way more scalable view rather than typical structure diagramm. This gives you opportunity to review whole project on one screen rather than scrolling through forest of classes with arrows connecting them.

On the screen below you can see DSM addin reviewing NUnit 2.4.8 dlls:














If you haven't yet got used to DSMs this little tool might open a new way for you to think about dependency analysis (if you're already using NDepend this addin won't do much for you, still it's lightweight and might find its uses). 

DSM consists of rows and columns. They indicate which namespaces use other ones to do their work:
  • Rows give you info what namespaces use particular namespace. For example namespace NUnit.Mocks on image above is being used by only namespace with number 340 - NUnit.Core. 
  • Likewise you can check which namespaces are being used with your module by looking at its column. NUnit.Mocks being represented by column with number 29 in header depends on NUnit.FrameWork.
DSM shows you circular dependencies. For example NUnit.Core and NUnit.Util are dependant on each other.

Typical DSM application allows you to dig deeper into modules for more information. You can do that as well with DSM plugin for Reflector.

In typical multilayered architecture where lower level layers aren't allowed to use higher leve
l functionality DSM will give you a picture of triangle - top right triangle wont have any numbers in it:











With even more strict rule where layer is allowed to use only its neighbour layer beneath it, the picture all numbers will be right under the diagonal line:











Plugin allows you to sort modules with partition command so you get a normalized view.

It takes some time to get used to DSM, but when mastered pattern matching mechanics of your brain will do a good job for you with help of this kind of utils. This little plugin will help you to make your first step in that direction.


For further reading on DSM check the following document:

No comments:

Post a Comment