If like me, you were dismayed to learn that Visio for Architects was not supported in Visual Studio 2008 you'll appreciate this upcoming tool; particularly if you want to reverse engineer your code so that you can create your UML diagrams without having to manually input all the class information.
Fortunately there is a workaround (I posted it HERE) which this utility performs. Without it there was quite a bit of grunt work involved - enough for me to push architecture to the back-burner. With a new requirement on the front burner I wasn't afforded this opportunity (to back-burner architecture). There are to many components for me to wrap my mind around the solution, so I'll have to architect the existing WPF Calculator to prepare a gap analysis so that I can successfully create a Managed Add-in Framework (MAF) module loader for my CompositeWPF SDMS solution.
For those that can't wait for the UI to be completed (like me) I completed the TDD of the controller - the process is fully functional. The two test that actually perform the work are remarked out (not shown in the screenshot below) because I don't want to inadvertantly convert the solution; I have my Visio document and have to back burner this utility for now.
Note below that the logger trapped some warnings. I created test for invalid files as well as non-existent files and the test passed as I attempted to crash the process.
After manually running the "Controller_CanPrepareVS2008SolutionForArchitecture" test I was able to open up my solution in Visual Studio 2005 - note that there are two projects that did not open - at a glance it looks like the WPF related projects (I have some more research to do). Since CALDemoApplication is on the "New" side of the gap analysis and the DemoApplication is mostly UI stuff I can worry about them later - what I needed was the main solution projects (which I have below). Updated: unfortunately UI has a great deal of logic in it (more below).
With my Visio document in hand I manually ran the "Controller_CanRestoreFromArchitecture" unit test and was able to successfully reopen my solution in Visual Studio 2008, compile and run the application with no issues.
IMPORTANT NOTE: when I was closing the Visual Studio 2005 solution (after creating the visio document) I responded "No" to save solution updates.
Note: I manually added the newly created DemoApplication.vsd document to my solution
Source code for above available at HERE - Change Set 23906. App | VisioTool | VisioToolModule and VisioToolModule.Tests
This is somewhat off topic but very cool so I'll mention it - below is the LINQ code I use to get my project list out of a Visual Studio 2005 / 2008 solution:
I created the query using LINQPAD - more about this HERE
UPDATED: I investigated the two projects that won't open. It appears the .NET 3.5 WPF Projects have a totally different header - it follows:
<Project ToolsVersion="3.5"
DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
The return on investment for supporting this new format (any efforts to convert it) are not worth it; particularly since I simply have to continue good programming practices and patterns for it not to be a problem; XAML projects will contain only UI code and I'll have all the supporting logic in class libraries (an example for my SDMS application is in the following image).
This does however cause a problem for me with the WPF Calculator program that I am architecting for my gap analysis. Most, if not all, of the wiring-up logic is sitting in the DemoApplication's CalculatorHost.xaml code behind file - not good... This is not good for reverse engineering nor does it promise to offer any reusable components (chomping at the bit for MEF to be released). So now I'm in refactoring mode - pulling all of the code out of code-behind and placing it in an external library. It's a painfully slow process because I have to refactor, test everything (there are no unit test), check-in and move another component and start the cycle over again....
The ROI for all this work is that the WPF Calculator is my POC (Proof of Concept); when I'm done refactoring to get the code out of the UI I can complete the Architecture work. My goal is to keep refactoring the WPF Calculator until it is a CompositeWPF application with reusable components that I can use in my SDMS application. The WPF Calculator UI will have less code than my SDMS UI does below so I have no issues with manually adding these objects to Visio:
Tags:
sdms,
visio,
linq
Categories: