Kevin Castle Dot Net
MyPicture.gif in content/binary
Navigation
RSS 2.0
Calendar View
<March 2007>
SunMonTueWedThuFriSat
25262728123
45678910
11121314151617
18192021222324
25262728293031
1234567
Categories
On this page....
Categories
Blogroll

Powered by: newtelligence dasBlog 1.9.6264.0

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

© Copyright 2008 , Kevin Castle

Send mail to the author(s) E-mail

 Wednesday, March 21, 2007

About 3 months ago I had a need to do some in-memory sorting on a generic list of objects which were being bound to a GridView control. Due to the fact that we were not working with standard ADO.NET objects and that LINQ has not been fully released, we decided to get clever and come up with a simple sorting method which could handle the case where the a list of objects could be sorted by any one of the fields which was clicked on the GridView control. Note: For the sake of simplicity, I created a dumbed down version of both the object and the sorting method, such that all properties were strings.

For weeks I had heard Sasha talk about how neat anonymous methods were in .NET 2.0, so we sat down and wrote out this nice little SortBy() function. 1st we enumerated through the generic list. 2nd we took the passed propertyname and did a compare between the properties in the two different customer objects. 3rd we used the SortDirection to determine how we would return the compare results. The result, a great little method which is capable of sorting a generic collection with only the objects propertyname and the sortdirection supplied.

 

public class CustomerList : List<Customer>
{

/// <summary>
/// Sorts the CustomerList using Generics, Anonymous Methods, and Reflection 
/// </summary>
/// <param name="propertyName">Property Name to sort the List with</param>
/// <param name="sortDirection">Direction to sort the List</param>
public void SortBy(string propertyName, SortDirection sortDirection)
{
    this.Sort
    (
        //Anonymous method used sort the base generic list.
        delegate(Customer item1, Customer item2)  
        {
            //Use reflection to get the Properties
            PropertyInfo prop1 = item1.GetType().GetProperty(propertyName);
            PropertyInfo prop2 = item2.GetType().GetProperty(propertyName);

            if (prop1 == null || prop2 == null)
            {
                throw new ArgumentException("Invalid property name: " + 
                    propertyName + " specified.");
            }

            //Get the property values from each of the objects
            string value1 = (string)prop1.GetValue(item1, null);
            string value2 = (string)prop2.GetValue(item2, null);

            int compareVal = Comparer.Default.Compare(value1, value2);
            if (sortDirection == SortDirection.Ascending)
                return compareVal;
            else
                return compareVal * -1; //return the negated value
        }
    );

}

}

public class Customer
{
    private string _id;
    private string _firstName;
    private string _lastName;
    private string _age;

    public string ID
    {
        get { return _id; }
        set { _id = value; }
    }

    public string FirstName
    {
        get { return _firstName; }
        set { _firstName = value; }
    }

    public string LastName
    {
        get { return _lastName; }
        set { _lastName = value; }
    }

    public string Age
    {
        get { return _age; }
        set { _age = value; }
    }

}


kick it on DotNetKicks.com

Post Date: Wednesday, March 21, 2007 2:38:41 PM (Pacific Standard Time, UTC-08:00)
Disclaimer | Comments [3] | Trackback   #
 Tuesday, March 20, 2007

Old news...but very cool if you didnt already know....Team Foundation Server Power Tools v1.2 was released.

The Microsoft Visual Studio 2005 Team Foundation Server Power Tool (formerly known as Power Toys) is a set of enhancements, tools and command-line utilities that improve the Team Foundation Server user experience. This release includes two new command-line tools for the developer and three non-command line tools: a process template editor, a set of custom check-in policies, and a test tools build task:

  • Team Foundation Server Power Tool Commands (tfpt.exe) - A command-line tool with enhanced functionality for Team Foundation Version Control with graphical user interfaces for some commands.
  • Process Template Editor - A tool integrated with Visual Studio for authoring custom work item types and some of the associated process template components.
  • Check-In Policy Pack - A set of handy check-in policies to address needs customers have expressed.
  • Test Tools Build Task - A tool that allows running unit tests by simply specifying the DLLs, or by specifying a file name pattern in TfsBuild.proj, instead of using .vsmdi files to specify tests to run.

I was a little bummed that the check-in policy pack didn't have any of the policies which I had requested (laughs)(especially since I posted on sending all of your comments). With that aside I couldnt have been happier with this release of the Process Template Editor. The integration with visual studio, the form control, and the validations were a great upgrade in this release. Note: You must first install the Domain-Specific Language Tools for Visual Studio 2005 in order for the Process Template Editor to appear in the Team Menu.

Here are a few screenshots of some of the process template editor features:

Screen - Editing the Process Template

Screen - Editing a work item type

Screen - Previewing the work item control

Screen - Work Item workflow

In the end, I couldn't be happier because this release came at the perfect time for me. I am steadily working on my Master's Project and alot my project will require me to customize the MSF for Agile process template, work items, and reports. Currently, my tentative title is "Customizing Team Foundation Server Process Templates for Software Quality Improvements". I know its quite a mouthfull, but I figured it would be a great way to learn the ins-and-outs of TFS and how to apply some of my MSE Master's knowledge to Microsoft's latest and greatest.


Post Date: Tuesday, March 20, 2007 8:13:57 PM (Pacific Standard Time, UTC-08:00)
Disclaimer | Comments [0] | Trackback   #
 Friday, January 19, 2007

After installing Team Foundation Server and Team Foundation Build, I came across a problem where I would successfully execute a Build on the project, however the build would not appear in the Build Report.

 

I opened up the Builds database on the TFS Server to see whether not the builds had been recognized. I found that the builds were being stored but that they were not being pulled over into the reports.

 

This issue is a result of the fact that the reports in TFS are pulled from the data warehouse and the not the Builds Database. In order to decrease the latency between your builds showing up in your Build reports (along with any other TFS changes not showing up in your reports....ex. closing out a bunch of work items and having it reflect on your "Remaining Work" reports) you can change the rate at which the datawarehouse is updated.

The warehouse is updated on a timer so in order to improve the turn around for your reports (or more importantly if you need to pull some reports from some data which has not been updated in the warehouse) then you can modify the update interval by calling this webservice.

Changing the Interval Setting

In Internet Explorer, open the following URL:

http://<tfsserver>:8080/Warehouse/v1.0/warehousecontroller.asmx?op=ChangeSetting

where <tfsserver> represents the name of the Team Foundation Server. A page that contains two boxes labeled settingID and newValue opens.

In the box labeled settingID, type RunIntervalSeconds.

In the box labeled newValue, type the new interval time in seconds.

Click Invoke to change the setting.

Security

To perform this procedure, you must be a member of the Administrators group on the Team Foundation application-tier server. For more information, see Team Foundation Server Permissions.

 

Manually Kick Off the DataWarehouse Update

1. Go to http://localhost:8080/Warehouse/warehousecontroller.asmx using a browser on the app tier.

2. Click the ‘Run’ link.

3. Press the ‘Invoke’ button.

This will trigger a refresh of the reports.

 


Post Date: Friday, January 19, 2007 8:12:57 AM (Pacific Standard Time, UTC-08:00)
Disclaimer | Comments [0] | Trackback   #
 Thursday, January 18, 2007

I meant to publish this document some time ago, but I haven't had much time at all to post anything lately.

This document was a result of early project research into what DAL and BLL code generation tool that we should use. In sum the project was a CRM web application which was to be developed using the MSF Agile process. The requirements were loosely defined and likely to change. Before I had started at the company, a developer had already created a prototype site for the project using the NetTiers template for CodeSmith. Initially, I was extremely impressed with the generated code but as I started needing more customization, flexibility, and stability I decided to do a small comparison between NetTiers and LLBLGen to see which product best served our project.

This .doc file is the result of my findings:

Code Generation Product Comparison.doc


In the end we decided to go with LLBLGen. Looking back  a few months ago I definitely feel that this was the best decision that we could have made. Our company is so impressed that a couple of our other projects have purchased licenses and are under development as we speak.

Biggest reasons why we chose LLBLGen over NetTiers:

  1. LLBLGen is much more flexible - We are capable of renaming entities, customizing property names, adding custom relationships, creating typed lists, etc.
  2. LLBLGen will probably be supported much more strongly. Since NetTiers is an open source project we were concerned about building an important (costly) application on something which would bear little to no responsibility on any vendors.
  3. NetTiers 2 was currently under development when we were considering the decision. As we modified the database and regenerated the project, we were running into both runtime and compiler errors.

Post Date: Thursday, January 18, 2007 8:34:08 AM (Pacific Standard Time, UTC-08:00)
Disclaimer | Comments [1] | Trackback   #
 Wednesday, January 17, 2007
  1. The first .NET application that I ever wrote was in J#.Net. That being said, I still share some reverence for the old language. Well() not() that() much() anymore().
  2. Up through my last year in college, I never had thought that I was going to work as a programmer/software engineer. At that time, my true passion was philosophy...so much in fact that my goal was to go back to grad school to become a philosophy professor.
  3. I surfed competitively for many years (as an amatuer). I was featured in a few surfing magazines, I finished equal 7ths in CA and in the top 20 at Nationals.
  4. I dated my wife for almost 11 years before we got married. We started dating in Jr. High and finally married a year after I graduated from SDSU.
  5. Although I hate to reveal something this terrible...At one point in my life I was seriously considered buying a mac. It was a sad day...but to my defense I was a confused Linux user at that time...please don't judge me.

Although nobody really tagged me for this. I still thought it would be interesting...especially since I need to get back into the swing of blogging. Currently, I'm working on a project which has had way too much of an aggressive schedule and its starting to take its toll on my time.

Here are some more from much greater developers/bloggers than I : Buck Hodges, Martin Woodward, Rob Caron, Eric Lee, Mickey Gousett.


Post Date: Wednesday, January 17, 2007 8:54:44 PM (Pacific Standard Time, UTC-08:00)
Disclaimer | Comments [0] | Trackback   #
 Friday, December 29, 2006

Flickr has decided to give the gift of additional bandwidth. Free accounts can now upload 100mb a month (previously 20mb) and Pro accounts now have unlimited bandwidth (previously 2gb a month).


Post Date: Friday, December 29, 2006 8:29:10 AM (Pacific Standard Time, UTC-08:00)
Disclaimer | Comments [0] | Trackback   #
 Wednesday, December 20, 2006

This is hardly breaking news for all those who are in fact, Database Professionals, but it was worth noting that this has finally been released. I'm not actively using this version of VSTS but the DB architect on my project simply rants and raves over how great this new tool is.

In my opinion, the coolest feature is the ability to do schema compares and data compares. I've always thought that these types of synchronization tools were extremely important for several reasons:

  1. It ensures that all of the staging environments are running off of the same database schema.
  2. It allows easy deployment promotions to Staging, QA, and Production servers. Its really easy to ignore individual changes made between deployments since it is now easy to run a comparison and generate a single large change script.
  3. It is a helpful tool for troubleshoot vague data access issues.

Here is a screenshot of the new VSTS Database Pro Edition using Schema Compare.


Post Date: Wednesday, December 20, 2006 8:52:41 PM (Pacific Standard Time, UTC-08:00)
Disclaimer | Comments [0] | Trackback   #
 Monday, December 11, 2006

Brian Keller has provided the opportunity for you to submit any Team Foundation Server questions for his upcoming Visual Studio Team System Channel 9 interview with Brian Harry. If you recall, Brian Harry recently posted about the roadmap for TFS, and in the interview he has agreed to take some questions. I submitted a question regarding TFS's inability to track requirements and if it will be released in subsequent versions...lots of people have been asking this.

Check out already-recorded VSTS Channel 9 videos


Post Date: Monday, December 11, 2006 9:30:02 PM (Pacific Standard Time, UTC-08:00)
Disclaimer | Comments [0] | Trackback   #
 Friday, December 01, 2006

One of the common gripes about Team Foundation Server is that fact that it doesn't support out-of-the-box continuous integration. Well Im sure the team had their reasons to exlude this feature in the first release, but hopefully we will get this in a future release. Until, then we will to come up with something on our own. Ben Waldron addresses these concerns in his Agile Development MSDN article on TFS and Continuous Integration.


Post Date: Friday, December 01, 2006 8:33:04 AM (Pacific Standard Time, UTC-08:00)
Disclaimer | Comments [0] | Trackback   #
 Thursday, November 30, 2006

Brian Harry's latest post lays out the roadmap for Team Foundation Server.

When I think about the TFS roadmap, I think about 3 different categories of things:

Servicing – These are Hot fixes, Service Packs, etc that fix bugs and add new capabilities to versions that have already shipped (today, that means TFS 2005)

Out of Band releases – We call them Power Tools (used to be Power Toys).  These are add-on tools/utilities that enhance the value of already shipped products without actually modifying them directly.

Major releases – These are the big new releases.  The next one is called Visual Studio “Orcas”.  In parallel, we are also actively developing for the release after Orcas, which I’ll describe at a high level.

...........

Please check out his post for a more specifics.

kick it on DotNetKicks.com

Post Date: Thursday, November 30, 2006 9:00:29 AM (Pacific Standard Time, UTC-08:00)
Disclaimer | Comments [0] | Trackback   #