BizC#Enterprise Architecture

Elegance is about doing it the simplest way

I am sitting in as team lead for a large project at ICC.  This is a multimillion dollar effort with over 100,000 installed user base.  We are using WPF and WCF and all of the latest TLAs.  In short, it is a big deal.

We are using Scrum Alliance’s TFS template to manage the development effort.  This is new to me – I am usually a functional independent, and not constrained by sprints and scrums and whatnot.  I am used to just getting the job done and that’s that.  when you have forty people on a project, however, you need to have some system.  This one is as good as any, I suppose.

Anyway, we did estimation for our first sprint last week, and I was here with a few other people entering the estimates into TFS Friday afternoon.  because TFS and Excel work well together, I chose to have the team enter the estimates into Excel, so that I could munge the CSV file with a script, and then import directly into TFS using the Excel integration.  Pretty slick, I thought.

The task names needed to be <document>.<entity>.<tasktype>.<taskname>, and I had those in a hierarchy format, like a legal format outline.  I write a little console application in C# to take the CSV file and figure out what all of the values were to create the task format.

static void Main(string[] args)
{
    StreamWriter streamWriter = new StreamWriter(@"C:\Users\wsempf\Desktop\R1S1 Backlog  Estimates Import.csv");
    using (TextReader testReader = File.OpenText(@"C:\Users\wsempf\Desktop\R1S1 Backlog  Estimates For conversion.csv"))
    {
        string line;
        string tasktype = string.Empty;
        while ((line = testReader.ReadLine()) != null)
        {
            string[] fields = line.Split(',');
            if (fields[2].Length==0 && fields[3].Length==0)
            {
                //do nothing
            }
            else if (fields[2].Length > 0)
            {
                //This is a type header
                tasktype = fields[2].ToString();
            }
            else if (fields[2].Length==0 && fields[3].Length>0)
            {
                //This is the data, write the line
            streamWriter.WriteLine("{0}.{1}.{2}.{3},{4}",fields[0],fields[1],tasktype,fields[3],fields[4]);
            }
            else
            {
                //whoops, do nothing
            }
        }
    }
}

It worked good – just a quick, one off script.  took me about 5 minutes to write.  I even had to refactor once when the task name format changed.  Anyway, I was pretty proud of myself when Larry Beall, the other dev working on the project, says “Done!”  I thought ‘Hey wait!  I have a cool script!’  but you see, Larry had done the same thing, but he had actually used Excel to do the work.

="Air Tariff." & A371 &"." & B371 & "." & C371

He went through and manually filled down the columns, but other than that … pretty simple solution.  The moral of the story – not everything is a nail so don’t always get out the hammer.  Sometimes the simple solution is the best.

Comments are closed
Mastodon