The most prevalent software architecture style is still "The Big Ball of Mud." Restructure101 for .Net from Headway Software is a superb weapon in our continuing battle against architecture entropy. Restructure101 parses an application and outputs a graphical dependency map of the components, classes and methods, in a format called Levelized Structure Maps (LSM). The LSMs provide a layered, drill-down/up structure that immediately reveals cyclic dependencies which Restructure101 presents as tangles.
An interesting user interface element is the Complexity Chart. The vertical axis shows the percentage of tangles in your code, and the horizontal axis shows the percentage of how "Fat" your code is. Fatness measures dependencies between methods within a class, or between classes within a namespace, as well as sheer bloat within your methods based on a Cyclomatic Complexity threshold you can configure. As you manipulate your code on the graphical layout, Restructure101 immediate updates the Complexity Chart, showing how fatness decreases as tangles increase, and vice versa.
You can create and manage any number of Sandboxes, which allow you to play and save "what if" structural refactorings of your code. When you have a Sandbox that reflects the structure you want, you can import this new structure into Visual Studio with Headway Software's Visual Studio add-in, which plugs into the VS build system and checks for structure violations whenever you compile your project source files. Each Sandbox is independent from others, and the Sandboxes can be stored in the Restructure101 repository until you delete them.
My evaluation included throwing at Restructure101 a product I am writing in C#/.Net. I was aware of several areas of architectural debt that I had allowed to build up. As an agile practitioner, I try to stay on top of my refactoring and keeping my code clean and understandable. When I pointed Restructure101 to my code, I was impressed with the speed of the UI rendering, and I meandered through the configuration settings to experiment with what Restructure101 could show me. I was also impressed with the variety of ways I could view my code structure: not only did Restructure101 show me the structural problems I already knew about, it showed me several I had no idea existed. My nUnit tests ran clean, my Builds were clean, but my internal dependency structure was not. I am happy to say that the next day my LSM looked much better after dragging my classes and methods around inside the Restructure101 LSM until my tangles were gone, and my fatness was significantly lighter! A couple hours of refactoring in Visual Studio and my code was in much better shape.
The speed of Restructure101's parsing is due to its optimization of data in local projects. Local projects store only the settings (e.g., class path/data file/granularity) required to load and view the code, so the structure of your code is re-created each time you open a project. But Structure101's repository lets you store persistent representations of your code's structure if you wish. Using the repository allows you to perform structural differencing to see changes between different project snapshots over time a very nice feature.
Although I evaluated ReStructure101 for .Net, Headway Software also offers Restructure101 for Java. Both retail for $900 per individual license, which is locked to a specific machine ID. Special pricing is available for academic or non-commercial personal use, and Structure101 is free for open source projects.
Gary K. Evans