Send mail to the author(s)

July 6, 2004

Visual Studio 2005 Class Diagram designer and the .NET Compact Framework

I'm back from Tech Ed now. Apologies for not blogging during the event, but I really didn't get that much chance to do so. Anyways, one of the big announcements from last week was the release of Visual Studio 2005 Beta 1. Over the weekend, I downloaded the ISOs and set up a Virtual PC image so that I could have a little play around with the new bits.

One of the things I wanted to test is the migration path from Visual Studio .NET 2003 to Visual Studio 2005, especially for Smart Device projects. As a good real world case, I took the source code for OpenNETCF.dll (the core library from the Smart Device Framework) and loaded it into Visual Studio 2005. The first thing that hit me was the new project conversion wizard. This converted my solution and project files from the VS.NET 2003 format to the new VS 2005 format. Runnning this on the OpenNETCF.dll project worked like a dream. No errors, no warnings. This really built my confidence for the next test -- a test I was a little nervous about running...

With the project loaded into VS 2005, I hit F6 to build the project... a few anxious seconds later and the build was complete. Successfully complete. ZERO errors. Taking into account that OpenNETCF.dll contains around 17,000 LOC (not couting comments and blank lines, which would bump things up to over 30,000 LOC. We like comments!), this was no mean feat. Congrats to everyone in VSD team for making this work as well as it does. Heck, and this is only Beta 1! Oh, my!

One of the new features of VS 2005 that I was really keen to investigate is the new Class Diagram system. This is some amazing engineering! You can create a UML-like diagram, complete with inheritance and associations, and have the diagram reflected in auto-generated stubs in your code files. Not only that but you can take existing code files, generate a class diagram for them, modify the class diagrams and then go fill in the implementation code for your modifications. Now that is a cool feature. This is something I for sure will be making use of a LOT!

As I said in a previous post, I want to post some screenshots of the Class Diagram designer, so here we go. As an exercise, I took the entire source code for OpenNETCF.Configuration (for the benefit of msmobiles, I created this :) ) and created a class diagram for this namespace. The LOC count for Configuration is around 1,700 LOC and is one of the bigger namespaces we have made available to you. Because of the size, it made a good test case for importing the classes into the Class Diagram designer and seeing how well the designer performed. The results were astongishly fast. I did some re-alignment of the individual classes in the diagram and produced the screenshot you can see below (click the image for a larger view):

Just take a look at that! So readable, so appealing to the eye, so informative. At a glance, I can easily get a feel for the object model being displayed. I can see the interfaces implemented by certain classes, and if I can any sub-classes, I would be able to see the relationships with their super-class (unfortunately, OpenNETCF.Configuration doesn't contain any sub-classes). Here's a more detailed view of the Class Diagram designer (click for a larger view):

So far, this definitely is my favorite feature of VS 2005. No doubt about that.