Visual Studio 2010 RC is available to MSDN subscribers here. General availability is set for the 10th of February. The RC includes a "Go Live License" and upgrade from RC to RTM.
Monday, February 8, 2010
Saturday, February 6, 2010
Things keep changing
It's obviously been a while since the last post. In that time I've changed jobs, not by choice, but definitely for the better. My previous employer had an issue managing cash flow and like many other companies, cried recession and let go some of the best talent in the organization. Interestingly enough it appears that all of the development staff including myself found employment within just a few days.
So the past couple of months have been about integrating into a new organization and attempting to become a contributor as quickly as possible. One of the things that irritate me when changing jobs is that you have to completely reestablish yourself. This is an issue that I never dealt with in my military career.
I'll be continuing the workflow series shortly, as Microsoft is set to release VS2010 RC, so I'll pick up with that release so stay tuned.
Monday, November 2, 2009
Workflow foundation 4.0 part 4
It’s taken a while to get to this point but based on the changes in beta 2 of Visual Studio 2010 and the .Net Framework 4.0 it was probably prudent to wait.
There are a number of changes in beta 2, for one the designer has been revised again. Also there is only a single workflow. To create the the different workflows, sequence or flow chart, you start by dragging the appropriate activity container onto the design surface. The tool box has also been reorganized. The different components are organized by functionality.
In this post, I’m going to build a simple console workflow to read RSS feeds, in future posts I’ll enable WCF communications and workflow persistence. This workflow will read any number of feeds passed in as a workflow argument and returns the results from the workflow instance to the console.
To get started, open Visual Studio and create a new Workflow console application named RSSReaderWorkflow. You can change the name of the workflow to anything you like or leave it as is. I renamed the workflow to ReaderWorkflow for this project. One thing to note, you may have to open the workflow in xml mode to change the class name. The designer seems to pass this by when you rename from the solution explorer.

Now we need to a couple of container classes. The first, RSSFeeds contains a list of feed uri’s. This is the list of feeds read.
using System;
using System.Collections.Generic;
namespace RSSReaderWorkflow
{
public class RSSFeeds
{
public List<Uri> Feeds { get; set; }
}
}
The second class we need to add is the RSSItem class. This class will contain the news items from the rss feeds that we read.
using System;
namespace RSSReaderWorkflow
{
public class RSSItem
{
public string Title { get; set; }
public string Link { get; set; }
public string Description { get; set; }
}
}
With that out of the way, drag a sequence activity from Control Flow section of the tool box. This is going to be a simple sequence workflow, so this activity serves as the container for the other activities we’ll add.
Next we’ll add two arguments one of the input named RssFeeds which is a type of RSSFeeds and is required.
The second argument is an out argument and will be a list of RSSItem. This will contain our feed results which we will display to the console.

Next drag an If activity from the tool box, we’ll add a condition to check that we have at least one feed to read.

Next in the else side of the if activity, we’ll add a throw activity. This activity will throw an argument out of range exception if the feeds count is zero.
Next we need to add a new code activity to read the feeds an populate the results. From the solution explorer right click –> add new item and select workflow and Code activity. Since we want to return the results of the rss feeds we’ll need to derive from TResult and add a bit of code. Here is the ReadFeedActivity class.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Activities;
using System.Xml.Linq;
namespace RSSReaderWorkflow
{
public sealed class ReadFeedActivity : CodeActivity<List<RSSItem>>
{
// Define an activity input argument of type string
public InArgument<List<Uri>> FeedUri { get; set; }
// If your activity returns a value, derive from CodeActivity<TResult>
// and return the value from the Execute method.
protected override List<RSSItem> Execute(CodeActivityContext context)
{
List<RSSItem> results = new List<RSSItem>();
foreach (var f in FeedUri.Get(context))
{
XDocument doc = XDocument.Load(f.ToString(), LoadOptions.None);
results.AddRange( (from i in doc.Descendants("channel").Elements("item")
select new RSSItem()
{
Title = i.Element("title").Value,
Link = i.Element("link").Value,
Description = i.Element("description").Value
}).ToList());
}
// Obtain the runtime value of the Text input argument
return results;
}
}
}
Now Build the project and the new activity will be avaliable in the tool box. You can simply drag it to the if activity.

Set the FeedUri Property to the RssFeeds.Feeds argument property.

Set the Result to the Results output argument property.

Now we need to update the main. It will create and pass in the the feeds and display the results.
class Program
{
static void Main(string[] args)
{
// set up a list of input feeds
Dictionary<string,object> wfArgs = new Dictionary<string,object>();
// the workflow is expecting a feed list object
RSSFeeds list = new RSSFeeds()
{
Feeds = new List<Uri>()
{
//usa today
new Uri("http://rssfeeds.usatoday.com/usatoday-NewsTopStories"),
//cnn
new Uri("http://rss.cnn.com/rss/cnn_topstories.rss")
}
};
// add the input to the args dictionary
wfArgs.Add("RssFeeds",list);
try
{
// the workflow will return a dictionary with the rss items
IDictionary<string, object> wfResults = WorkflowInvoker.Invoke(new ReaderWorkflow(), wfArgs);
// loop through the keys
foreach (var item in wfResults)
{
// cast the value as an RSSItem list
List<RSSItem> res = item.Value as List<RSSItem>;
// display the results
res.ForEach(i => Console.WriteLine(i.Title));
}
}
catch(ArgumentOutOfRangeException e) // if you comment out the feeds, you can watch the throw in acction
{
Console.WriteLine(e.Message);
}
Console.Read();
}
}
Now we have a simple workflow that reads RSS feeds.
Monday, October 26, 2009
SKU’d again
Another Visual Studio Release and another round of SKU’s. It seems the marketing folks in Redmond that had a hand in this where the same ones that brought us the Vista and Windows 7 product line up.
So here is the basic break down of the Old versus the New SKU’s for Visual Studio 2010.
- Visual Studio Standard and Visual Studio Professional become VS 2010 Professional
- Visual Studio Professional with MSDN Premium and Visual Studio Professional with MSDN Professional become VS 2010 Professional with MSDN
- Visual Studio Team Dev, Database, Architect and Test become VS 2010 Premium with MSDN
- The Visual Studio Team Suite becomes VS 2010 Ultimate with MSDN
Of course Express is still available as before for the hobbyist, as before one for each language. There is also a combo install for express, but quite frankly I haven’t had time to look at it.
Microsoft is also offering an upgrade offer for MSDN Premium subscribers during the “transition” time, that will allow you to activate a premium subscription now and get Ultimate when Visual Studio 2010 is released in or around March of 2010.
In the end I find these marketing name games a pain, I like the seeming simplification, the names are to Windowy for my taste.
Sunday, October 25, 2009
What's New in EF 4
Tuesday, October 20, 2009
The UI is greatly improved since beta 1, here are a few screens to wet your appetite while you wait.
The Install start screen.

More install

Install process

The start up screen has been greatly enhanced since beta 1.

There are a number of changes, in fact too many to list in a single entry. Look forward to the continuation of the workflow series shortly..
Thursday, October 15, 2009
Practicing Scrum or Doing Scrum?
If your organization is like any other today, they’re looking for ways to cut costs and deliver on time and for many development teams it means Scrum or some variation.
When you ask your peers what methodology they are using many will say Scrum, but the fact of the matter is Scrum is not a methodology it is a wrapper around existing methodologies. Scrum will work with anything from CMM to XP.
In the company I’m with now we do sprints, planning and daily stand up meetings. Even doing those things we’re not really practicing Scrum, we’re doing Scrum. We’re just going through the motions and when you do that quality is the first thing to suffer followed by moral. Each sprint becomes a death march and the developers don’t really pay much attention to what is on the backlog, it’ll be rolled forward if it’s not finished. You also begin to see backlog fudge, where some pet project or desire is added because someone felt like that’s what they wanted to do. Inevitably we no longer release or demo functionality to the users and owners at the end of the sprint. We’ve gone from Scrum and XP to “Scrumterfall” Waterfall with a Scrum veneer.
So how do we bring turn around from just going through the motions to reaping the benefits of practicing Scrum?
The first thing that needs to be addressed is the backlog. The backlog need to be scrubbed and reprioritized. This process needs to happen on a continual basis, otherwise the backlog becomes stale.
Once we have a well prioritized backlog, we need to plan the sprints. Normally we plan sprints for two or three weeks, which honestly is not enough time, especially in a greenfield project, such as the one we’re currently working on. Sprints should ideally be thirty days. I like thirty work days as opposed to thirty calendar days, that way you know exactly what time you have to plan and execute with. Planning shouldn’t be a one or two hour meeting where you grab enough items off the list to fill the available velocity. Rather planning should last for a whole day. The highest priority backlog items should be broken down enough to give a decent effort. Once you’ve selected and planned the backlog based on releasing working functionality you’re halfway there. It is essential that all the team members buy into the work to be performed and agree that it can be accomplished.
During the sprint the Scrum master needs to play the role of “Heavy” and eliminate interference and remove obstacles from the dev teams goal. He/She needs to insure the backlog doesn’t grow to include “pet” projects or “I feel like doing something else” backlog items. He should lead the daily stand ups using a simple format. What did you do yesterday?, What are you doing today? and What obstacles are preventing you from completing your tasks? The daily stand ups are not optional affairs, they should include everyone always, no excuses.
The team should work to accomplish all the tasks planned for the sprint, but realize that you may not always complete all of the backlog items for a given sprint. You may also discover during the course of the sprint that the scope of some backlog items were underestimated or impacted more than originally thought.
The sprint should be closed out with a demo of the features implemented during the sprint. Invite users and management to come and try the functionality for themselves. Involving the users is key, if they’re not engaged or see no tangible benefit they’ll be less like to support further development.