VS2010 Architecture Explorer Analyzers

DGML, the new VS2010 visualization technology has capabilities to render graphs. Graphs like dependencies between classes, inheritance graphs, custom graph, you actually can visualize any relation you want. Cameron Skinner has posts about DGML and Chris Lovett has some great video’s.

[class dependencies uml2doc.codeplex.com]

Now the interesting thing is that you can analyze these graphs. In the image below you see the analyzers; Circular ReferencesHubUnreferenced.
The purple classes are unreferenced which probably means dead code or entry point of the application. The kind of blue-green nodes are hub, classes which are important and heavy used, and no strongly connected classes in this solution.


Make your own analyzer.

You also can make your own analyzer. For example code coverage or naming conventions or … whatever you can imaging. In the example below I created an analyzer which marks the nodes green with the string ‘Clemens’… (code you know is great:)



Ok, maybe not that interesting analyzer, more interesting is the creation… in the /PrivateAssemblies/Providers folder there are already several analyzers available, actually the ones mentioned above.


A small analyze of this assembly tells us that all the analyzers are using the IProvider interface and the ProviderAttribute [see below]. After some more exploration you will find that the prgroesion.common assembly has a method ‘ProviderDiscovery’ which looks for classes in the provider directory.


so, making a assembly with the code below is a good start:

[Provider(Name = "ClemensAnalyzer")]
public class TestAnalyzer : IProvider

In the void Initialize(IServiceProvider serviceProvider); you have to initialize your provider, register the actions and action handler [action.ActionHandlers.Add(new ActionHandler(this.OnAnalyzeTests));]… which calls your analysis…

foreach (Node node in this._graph.VisibleNodes)
       if (node.Label.Contains("Clemens"))
                  node[HasClemens] = true;

the node[HasClemens] = true; is some additional meta data you add to your diagram: private static GraphProperty HasClemens = GraphProperty.Register("HasClemens", typeof(bool), new GraphMetadata("Clemens","This one contains Clemens",null,GraphMetadataFlags.Default), typeof(TestAnalyzer));

All this and a bit more [didn’t finished the analysis completely, there is a lot more possible] result in your own analyzer…


Now, let’s start making a useful one :-)

Comments (36) -

Nice looking site and I like the way you write. I just love BlogEngine as well.  Where did you get your theme?

Nice subject area that you have chosen.

I believe my dad is doing something similar. Good luck to you.

<P>Hey, This is a great thread. I found you on msn. Keep up the work.</P>

valuable information and excellent design you got here! I would like to thank you for sharing your thoughts and time into the stuff you post!! Thumbs up!

cant wait to see your next post

Heya i got to your site by mistake when i was searching bing for something off topic here but i do have say your site is really helpful, like the theme and the content on here...so thanks for me procrastinating from my previous task, lol

strange this post is totaly irrelevant to the search query I entered in google but it was listed on the first page.

Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I'll be subscribing to your feed and I hope you post again soon.

Thank you so much for this extremely high quality column.

My brother bought a new one for my home. However I'm running into some trouble and I am looking for help.

Great post, very informative, thank you for sharing!

This is a very high quality post you have put up.

Currently traveling between Miami and Florida, reading this on my Iphone. Will read it in full when I get back, and I will also post a backlink on my website. Thanks.

Hey man. Sending this from a Mobile. thanks! very helpful post!! like the template btw ;)

I was looking for a blog in this subject. I think I will become a great follower. I was thinking about making my own place about a similar interest. Some useful ideas here. Thanks, I can only hope mine turns out as useful as this one.

I like your style, the fact that your site is a little bit different makes it so interesting, I get fed up of seeing same-old-same-old all of the time. I've just stumbled this page for you :-D

Hi, good stuff!! bookmarked Smile Thx and best wishes from Georgia!<P></P>

I always wondered where Architecture Explorers came from. Now I know, and it's soooo awesome.

I thought this was going to be another long boring blog post, but I was pleasantly suprised. I will be posting a backlink on my blog, as I am quite sure my readers will find this more than interesting.

You have a interesting posting. I liked reading it very much.  Thanks keep up the great work.

Hello. This is kind of an "unconventional" question , but have other visitors asked you how get the menu bar to look like you've got it? I also have a blog and am really looking to alter around the theme, however am scared to death to mess with it for fear of the search engines punishing me. I am very new to all of this ...so i am just not positive exactly how to try to to it all yet. I'll just keep working on it one day at a time Thanks for any help you can offer here

my God, i thought you were going to chip in with some decisive insght at the end there, not leave it with ‘we leave it to you to decide’.

Just want to say your article is striking. The clarity in your post is simply striking and i can take for granted you are an expert on this subject. Well with your permission allow me to grab your rss feed to keep up to date with forthcoming post. Thanks a million and please keep up the ac complished work. Excuse my poor English. English is not my mother tongue.

superb posts. Mind sharing how you get the info for your posts. What more special to be posted.

Hi, I've been a lurker around your blog for a few weeks. I like this writing and your whole site! Keep writing!

I really like this topic...I'm thinking about adding my opinion but I want to hear some more from others first

Great post, very informative, thank you for sharing!

your blog posts are really amazing. What more special to be posted.

Great spot communicator.

The blog was absolutely fantastic! Lots of great information and inspiration, both of which we all need!

While I wasdoing some browsing and noticed your website appears a bit confusedin my K-meleon internet browser. I think I'm the only one still using it....

lot of good information, I come here all the time and am very happy with your updates, Thank you!

Hey - nice blog, just trying around some blogs, appears a pretty nice platform you are using. I'm currently using Wordpress for a few of my sites however trying to change one in all them over to a platform like yours as an endeavor run. Something in particular you would recommend about it?

Thank you for one more great article. Where else might anyone get that sort of information in such a perfect approach of writing? I have a presentation next week, and I'm on the planning for such information.

Add comment