This blog has been moved to Redwerb.com.

Saturday, April 28, 2007

Windows Workflow and Your Next Build System

Recently I've been messing around with the new workflow foundation developed by Microsoft and included in .Net 3.0. It is very cool! It has great design-time support, it's easy to extend with your own custom activities, and it seems to be very well documented.

At first I was a bit put off by the fact that it doesn't include a simple, run-time configuration process. They do give you the ability to host the designer in your application, but it appears that you have to write a lot of code to make that work (I didn't actually try it, but I did glance over the documentation). However, as I thought about it more, it seems that Visual Studio is a great way to reconfigure the workflow. It might be a bit of overkill for a non-technical person who just wants to reconfigure one or two of the activities, however, if they just go to the workflow designer, it seems pretty easy to use (but what would I know, I'm a developer :). On the other hand, if somebody that is more technically inclined wants to extend the workflow with code, they can do that easily as well.

If you are new to Windows Workflow, I think a build system is a great starter project. It's simple (as far as workflow is concerned anyway), it fits into the workflow concept very well, and it will make your build process easier to configure and extend (if your build process is anything like our current one, as long as it's working, the last thing anybody wants to do is touch it). Even if you don't use it for the build process for the entire product, it can make many tasks that you have to perform on a regular basis on your computer easier (such as preparing your machine for a new build).

Before you can start building a workflow, you will need to install .Net 3.0 as well as Visual Studio 2005 extensions for .NET Framework 3.0 (Windows Workflow Foundation). This will provide the necessary pieces that Visual Studio needs to create workflows.

For the build system I'm creating at work, I created a Workflow Activity Library (a project template available in the New Project dialog) that contains most of the activities that I want to use, such as GetFromVSS, CopyFiles, RenameFile, AttachDatabase, RunSQL, etc. Each activity has one or more properties that allow it to be configured (for example, RenameFile has a property for the path to the file and another property for the new name of the file). As you can tell, these are just building blocks for a build system. For the build itself, I create a Sequential Workflow Console Application (this is a new project type installed with the VS 2005 workflow extensions). If you have several different types of builds (such as a developer build, test build, and production build), you can create a separate project for each one.

So what makes Windows Workflow such a great tool for a build system? Other than making configuration easy, you can also disable activities. This is very useful, especially when testing. There are several parts to the build system that I'm working on (for example, compiling the code and building the database), each one is made up of several activities. I can simply create an activity that contains all the activities for that part of the build and, if I don't want to run it, I can simply click on the parent activity and set it's Enabled property to False.

The diagram below shows a very simple workflow diagram in the Visual Studio Workflow designer. It includes two activities, one of the activities has been disabled. As you can see, the Workflow designer is very similar to the WinForm designer. You start by picking the activity that you want to run from the toolbox (on the left) and dragging it onto the workflow. The workflow will show you the places that you are allowed to drop the new activity. Once you drop an activity onto the workflow, you can set the properties associated with it using the property window (on the right).

If there is interest, I might be willing to write a more detailed article for Code Project that includes sample code. So if you want to read more, make sure you leave a comment.

Friday, April 27, 2007

Speakeasy Connection Speed Test

Here's a fun tool I found out about recently. It's an online utility that tests your connection speed. It basically just downloads a file and gives you a download speed and then uploads a file and gives you an upload speed. However, they have a pretty slick interface, check it out below.

Speakeasy Connection Speed test

Tuesday, April 17, 2007

Silverlight now available

On April 16, Microsoft unveiled Silverlight (formerly known as WPF/E). From the website...
Silverlight is a cross-browser, cross-platform plug-in for delivering the next
generation of media experiences and rich interactive applications (RIAs) for
the Web.

This could be the Flash killer, though it will probably take a few years to get there. I haven't actually seen the development environment for this, but if you can use .Net (or something very similar), Visual Studio 2005, and Expression Suite to build it, then this will be very compelling for a large number of developers.

Friday, April 13, 2007

Visual Assist X

I can't believe I haven't blogged about Visual Assist X (VAX from here on) yet! It is one of my favorite developer tools and has changed the way I write code.

VAX is an add-on to Visual Studio that provides a number of features that helps developers be more productive. My favorite feature is the Intellisense filtering. Intellisense is one of the greatest productivity enhancements for developers since the advent of the IDE, however, it can sometimes be difficult to find what you want in the list. VAX filters the Intellisense so that you can find what you want.

For instance, if you have a class that has hundreds of methods including one called DoSomethingReallyCool and you need to call it but can only remember that it contains the word 'Cool' somewhere in it, with typical Intellisense, you have to search every single member of the class. However, with VAX, you just type in 'MyVariable.Cool' and Intellisense will filter the list to include all the members with the word 'Cool' in it (the home page of their website shows this very well).

Using this filtering technology, you can also type 'MyVariable.DSRC' + Tab and it will auto complete for you! Once you become used to this you will find yourself typing far fewer characters. It's like snippets without having to setup snippets.

The Intellisense filtering makes VAX worth every penny of the cost, however, it also includes some other great features...
  • Spell Check - Who doesn't need a spelling checker? VAX will check your strings and comments. It seems to be smart enough to recognize code names in your comments.
  • Enhanced Code Element Visualization - Adds more colors and styles (like bold and italics) to different code elements.
  • Reference Navigation - Provides the ability to navigate to code that references a class, class member, or variable. Very handy when trying to fix a bug in somebody elses code :).

VAX also includes a bunch of other features, but these are the ones that I use most often and have really helped me be more productive. If you like productivity tools, this is definitely one that you should be using.

Friday, April 06, 2007

Pro Version of Visual Studio Will Include Unit Testing

Good news, the pro version of Orcas (next version of Visual Studio), will include the unit testing features available in the Visual Studio 2005 Team Edition for Software Developers (from here on, VS for Devs). The big question is, will it be better than NUnit?

The team I work in uses NUnit for unit testing and I have not worked much with the unit testing built into the VS for Devs so I'm not sure of all the capabilities. The questions I am most interested in are...

  • Can our current NUnit tests be converted to the MS unit test framework.
  • Can the unit tests be run from a command-line build process without VS for Devs installed (or team system)?
  • Can the unit tests be filtered so that only certain tests are run during builds?

I have yet to install Orcas. The latest CTP was released in March. There are rumors that another CTP will be released in this month (possibly even a beta). Perhaps if the beta is released I might install it on a virtual PC. I'm pretty excited about some of the new features, such as LINQ and extension methods (ScottGu's Blog has a good article on this). Hopefully they will be able to release Orcas some time this year (though I've heard rumors that it might not be until 2008!).

Tuesday, April 03, 2007

Expression Now Available With MSDN

Good news from Microsoft! According to Somasegar's blog, Expression Web is now available through MSDN and Expression Blend will be available through MSDN once it has been released. Expression Design and Media will not be available through MSDN, but those tools aren't intended for developers, so there isn't as much of an expectation to have them as Web and Blend.

Expression Web is Microsofts replacement for FrontPage. Expression Blend is a new tool for designing desktop applications using XAML.