Feb 1 2010

An Alternate Branching Strategy

Category: David @ 14:04

Now that I have been working with TFS for a while I’ve done some experimenting with my Branching Strategy after much consultation with the Branching Guides that are available on CodePlex (TFS Branching Guide 2.0, TFS Branching Guide 2010). These guides have a wealth of information that should most definitely be consulted when you are considering your own Branching Strategy.

One of the keys to a successful branching strategy is to branch when necessary and only when necessary; no more, no less.  That being said, there are still a number of valid ways to branch from the most basic to the more complex.  Here are three diagrams from the TFS Branching Guide that show the three most common branching strategies.

Basic

image

Standard

image

Advanced

image

As with all guidance, there are exceptions.  In my case I was looking at the Standard branching strategy and finding myself in a situation where there were times when I needed to perform several Hotfixes over a course of time.  However, with at least one of my products there was no way to determine how many Hotfixes we were going to have before the next major release.  Following the Standard or even Advanced strategy didn’t allow me to dynamically add Hotfix releases as an issue was resolved and ready for RTM.  So, I came up with the idea of branching from MAIN to a Baseline Production branch from which all my other RTM branches would originate.  This allows me to create a new Hotfix branch as needed from a common Production branch.

The diagram for my Branching Strategy ends up looking like this:

Branching Diagram

This strategy falls somewhere between the Standard and Advanced strategies defined in the Guidance but also incorporates the flexibility to branch for Hotfixes when needed.  It also allows for concurrent development on a Service Pack should that be needed while still having the Baseline Production branch that acts as an accumulation point for all changes on Production code.

I am sure I am not the first one to come up with this particular strategy since “there is nothing new under the sun.” So, I would love to hear what you all think about this particular strategy.  What do you like about it? What do you see as some of the issues with it?

Tags: , ,

Jan 5 2010

The St. Louis .NET User Group is SOLID

Category: David @ 15:39

If you’re a developer in the St. Louis area make sure make it to the next St. Louis .NET User Group meeting.  A good friend of mine, Chris Deweese, will be giving a presentation on the SOLID principles of software development.

Tags:

Dec 30 2009

Missing TFS SharePoint Portal Action Menus

Category: SharePoint | TFS | Team Foundation ServerDavid @ 16:33

My team at work has finally gotten to a good point for migrating our source code for several of our products into Team Foundation Server.  I have been using the Workgroup edition of TFS at home for over a year now and really enjoy the features of both the source control as well as the project portals.  In fact, I haven’t had a single issue with TFS at home which is why when I ran into a puzzling issue with my project portals at work I really got thrown for a loop.  With my new portals I was experiencing an issue on both of my development machines that was preventing various action menus from being displayed on the home page as well as in my document libraries and on other pages.

For instance, if I was in a document library and tried to open the drop down menu for a given document I would get a Javascript error of Object expected generated in the script from the ~/_layouts/1033/ows.js file.  Here’s a screenshot of what I was getting:

image

 

 

So, after spending two days reviewing permissions in TFS, verifying that IE was up to date, working with our local SharePoint expert, and searching on Bing and Google till my eyes bled, I had just about given up.  Then this afternoon I found what I was looking for here. Come to find out my whole issue was the my User Agent string being generated by IE was too long for the TFS WSS instance to handle properly which resulted in the thoroughly baffling behavior I was seeing on my portals.  Since I have every version of the .NET Framework on my machine, plus a slew of other add-ins and applications my UA string was well over 200 characters.  So, to resolve it I made a few edits in the registry to eliminate the nonessential keys being used in IE to generate my bloated UA string.

If you are having these same issues, you can check your UA string length here. And if you need to shorten it, you can find a quick guide for the registry keys to pin point here.

Tags: , ,

Dec 18 2009

Deploying a SQL Schema Update Script from VS2008 DB Edition in SSMS

Category: David @ 13:32

One of the challenges that most every developer faces at one time or another is the challenge of pushing database changes to their production environment.  For some time now I have been using the database management tools in Visual Studio 2008 Database Edition.  One of the great things about this tool is that it allows you to perform both schema and data comparisons between different databases or between the project schema and a database.  Consequently those changes can also be synchronized through Visual Studio or by generating a change script. 

imageIn my organization changes to a database that involve schema objects must be performed by a DBA although the actually SQL scripts are often written by the developer.  The easiest way for me to provide the appropriate script for the DBA is to simply use the Schema Update Script that is generated by Visual Studio by default.  To show the script simply click the “Show Schema Update Script” button.  This will force the Schema Update Script panel to be displayed.  Often I simply copy the text out of that panel and paste it into a text file to send to my DBA.  He can then open the script in SQL Server Management Studio and run it from there.

image While explaining this process to a member of my development team I realized that there is one very important step that you need to take in SSMS to be able to successfully run the script.

By default the Query Editor in SSMS cannot run a query that has scripting in it compatible with SQLCMD.  Therefore it is necessary to turn on the SQLCMD mode in SSMS.  So, here it is, in SSMS simply click on the Query menu and then toggle on SQLCMD mode menu item. 

Now you can run the Schema Update Script successfully!

Tags:

Dec 7 2009

A New Old Friend: Windows 7 and a Tablet PC

Category: Hardware | Windows 7 | Tablet PCDavid @ 12:18

About a month or two ago I started looking into buying an eReader after seeing an ad for the new nook reader from Barnes & Noble. As an avid reader and graduate student I have more than a few books and the prospect of eliminating some of the need for bookshelves is pretty enticing. Ultimately after looking at various devices I discovered that Barnes & Noble provides their eReader software for free here. Once I realized that, I started to expand my search for a device and eventually decided that I could get a lot more functionality from a Tablet PC device for a cheaper price.

250px-Tc1100-2250px-TC1100-1After researching my options for a new device, and given my available funds, I opted for an older HP tc1100 on  eBay for right at the $200 mark. For those who aren't familiar with this device let me give you a quick run down. The tc1100 is a hybrid tablet PC that was manufactured by HP until late 2005. My particular model has a 1.1GHz Pentium M CPU with  2 GB of RAM. It has the ability to operate as a slate style tablet or with a removable keyboard it functions as a standard laptop as well. All that said, it's a modest machine when compared to current Netbook specs.

The great part of this device, and the point of this post, is that this Tablet PC  is just powerful enough to run Windows 7 and take advantage of the great features it has! To be honest, I never really thought seriously about getting a Tablet PC. I always figured that a laptop was good enough for my needs. Well, I wish I had this Tablet a long time ago! Here are a few of the features that have sold me on this Tablet and Windows 7:

1. Free Form Handwritten Notes

image The Windows Journal is absolutely awesome!  At work my constant companion is a notepad, mechanical pencil and a large pink eraser.  I often think best when I am writing things down, but I have also often wished that I didn’t have to deal with having to keep track of the multiple notepads.  Now with Windows Journal I can take as many notes as I want and never have to worry about keeping track of multiple notepad again (much less running out of lead in my pencil, or having to deal with eraser dust!).  There are a number of page templates from regular lined notebook paper to blank pages and graph paper.

2. Web Browsing

There are actually a couple of things I like about browsing the web with a Tablet PC.  The first is that the form factor of this one is just the right size to hold in your hand for convenience without needing to have a laptop in your lap burning your legs.  This particular Tablet has a 10.4” screen and the .  Secondly, since it’s Windows 7 it is the full version of your favorite browser.  I currently run IE 8 as my preferred browser.  One really cool feature of browsing with the digital pen is that I can click on any link and drag the pen a fraction of an inch off of the link and it will automatically open the link in a new tab.  This is a surprisingly convenient and intuitive feature.

3.  Handwriting Recognition

image Windows 7 has a handwriting recognition panel that can be displayed whenever the pen comes into active range of the screen.  This panel provides a dynamically sized area that will convert your handwriting into text.  I have been amazed at how accurately it can decipher my chicken scratch.  There is something about the tactile experience of writing that is quite fulfilling, of course it’s also nice to have a 95% keyboard to make things go a little faster when needed.

 

4. The Hardware Form-Factor

The last thing I’ll touch on in this post is the actual form-factor of the HP tc1100.  There are a huge number of things I like about the “convertible” Tablet PC form-factor.  The ability to minimize the thickness and weight of the device by removing the keyboard is absolutely cool.  I love being able to just carry the screen around without the bulk of the keyboard.  Without the keyboard attached the design resembles a closed Macbook with it’s smooth rounded corners and edges.  The three side hard buttons and jog dial are customizable.  I was even able to add some custom script that locks the tablet when you press and hold it.  Switching between screen layouts is a breeze with the press of a button.  There are even three soft buttons built into the bezel of the screen that perform various convenient tasks.  All-in-all I, along with thousands off others, wonder why HP chose to stop making this particular model when it was absolutely unique to the market (and still is) and has so many great features.

Finally,  If you happen to be on eBay and can get a tc1100 for cheap then by all means I think you should give it consideration. (I recommend going with one that has either a 1.1GHz or 1.2GHz CPU.)  Even if you don’t want to go the older hardware route, go ahead and check out a newer Tablet PC, I think you too will be surprised at what you find.

Tags: , ,

Dec 1 2009

Silverlight 4 Overview @ PDC 2009

Category: .NET | SilverlightDavid @ 13:41

If you haven't been paying attention to Silverlight lately then you may not know that Microsoft released a beta of Sivlerlight 4 during PDC.  Here is a great webcast, presented by Karen Corby, that gives an overview of the new Silverlight 4 features.  Check it out when you get a chance...No, strike that, go right now and watch it!

Tags:

Nov 16 2009

Got ViewState?

Category: .NET | ASP.NET | Best Practices | Tips & TricksDavid @ 10:58

A few months ago I wrote a couple of posts on Managing Session Variables in ASP.NET using a Proxy. Since then I have thought about the need to write a post addressing the use of the ViewState as well.  As with SessionState,  ViewState is essential just a Dictionary of String, Object pairs.  This means that at design time you have to do a fair amount of type casting to use the objects you store in ViewState in a strongly typed manner.  It also introduces many of the same issues as using the native SessionState, such as:

  • the inability to know where you are using a given ViewState variable in your code.
  • the potential for mistyping a ViewState key when putting an object in ViewState or retrieving.
  • the increase in code to check for null values returned from ViewState.

Each of these issues is a pain to deal with on their own, but when the issues are compounded over a complex page then it really can make for a bad experience when developing.  The solution to this problem that I propose is to use custom properties on the page to access the various objects that are stored in ViewState.  Below is an example of a code behind page that illustrates how to do this.  This example assumes you have a class Person that defines properties of FirstName, LastName and ID, as well as a web page with two textboxes and a button.

   1: Partial Public Class _Default
   2:    Inherits System.Web.UI.Page
   3:  
   4:  
   5: #Region " Fields "
   6:  
   7:    Private Const _personViewState As String = "MyPerson"
   8:    Public Const QueryStringParameterPersonID As String = "pid"
   9:  
  10: #End Region
  11:  
  12: #Region " Properties "
  13:  
  14:    Public Property Person() As Person
  15:       Get
  16:          If ViewState(_personViewState) Is Nothing Then ViewState(_personViewState) = New Person
  17:          Return CType(ViewState(_personViewState), Person)
  18:       End Get
  19:       Set(ByVal value As Person)
  20:          ViewState(_personViewState) = value
  21:       End Set
  22:    End Property
  23:  
  24: #End Region
  25:  
  26: #Region " Methods "
  27:  
  28:    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
  29:       If Not String.IsNullOrEmpty(Page.Request.QueryString(QueryStringParameterPersonID)) Then
  30:          'Get your user from your datastore and populate the Person Property with the returned user.
  31:          Person = PersonDAO.GetPersonByID(CInt(Page.Request.QueryString(QueryStringParameterPersonID)))
  32:       End If
  33:  
  34:       FirstNameTextbox.Text = Person.FirstName
  35:       LastNameTextBox.Text = Person.LastName
  36:  
  37:    End Sub
  38:  
  39:    Protected Sub SaveButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles SaveButton.Click
  40:       Person.FirstName = FirstNameTextbox.Text.Trim
  41:       Person.LastName = LastNameTextBox.Text.Trim
  42:  
  43:       'Persist your Person to your datastore, etc.
  44:    End Sub
  45:  
  46: #End Region
  47:  
  48: End Class

In this example you can see how I have abstracted the access to my ViewState Person object into a property that always returns an instance of a Person. You can of course have this property return null (Nothing) if you need or prefer that for your own development.  Either way you are still eliminating the direct reference to the ViewState allowing you to program against a strongly typed object.  As I did in my SessionProxy posts, I am using a private constant to hold the string value of my key to eliminate the chance of mistyping this value when using it in multiple places.

Another technique that I would like to point out in this post is the use of public constants to represent the string value of the query parameter names for this page.  By exposing a constant representing this value I then make it possible for other developers to easily see the parameters that my page accepts.  If they utilize the constant it will also allow me to change the actual string value of my parameter name at any point in time without affecting the functionality of my page. (I realize this is a big “If” that is reliant on team standards.)

Tags: , , , , ,

Oct 1 2009

Growing as a Developer

Category: Leadership | Personal GrowthDavid @ 08:00

I was reflecting recently on my own growth as a developer over the last several years.  There are two factors in my own development that I identified as playing a significant and indispensible role.

Partners-In-Crime

I have been privileged over the last couple of years to work with other developers that have spurred me on to new heights in software development.  There has been a mutual give and take of discoveries and lessons learned.  There has even been a friendly sense of competition in challenging one another to keep learning and growing.  Unfortunately two of the most influential developers during this time aren’t as big a part of my professional carrier as they once were.  One has moved on to a new company and the other is in the process of transitioning to another company.

I can’t emphasize enough the importance of having these types of peers.  More over, it is highly important that you and they see the process of learning and growing as something to be shared.  We all know, or have known, those types of developers that, for one reason or another, lock themselves into a citadel of their own knowledge and refuse to help others grow and thereby restrict their own growth.  I am opposed to this type of mentality and believe that we should all strive to challenge each other to grow and to help each other do so.  It is one thing to tell another developer where she needs to grow, it is another to play an active role in helping them to grow.

Pages that Turned Me

In addition to my friends, there have been several books that opened whole new concepts and areas of growth for me.  Below are four books that have enlightened, taught and challenged me.  There have been others, but these were among the first that pointed me in a new direction and helped me to “turn over a new leaf” as a developer.  I would encourage anyone that hasn’t discovered these books to seriously consider making them a part of your library.

Code Complete, Second Edition

     Code Complete: A Practical Handbook of Software Construction
     Author: Steve McConnell

 

 

 

 

    

     Rapid Development: Taming Wild Software Schedules
     Author: Steve McConnell

 

 

 

 Cover Picture

 

 

          Refactoring: Improving the Design of Existing Code
          Author: Martin Fowler

 

 

 

 

          Design Patterns: Elements of Reusable Object-Oriented Software
          Authors: Gamma, Helm, Johnson and Vlissides

 

 

 

Tags: , ,

Sep 22 2009

Expression Encoder 3 Screen Capture Application

Category: David @ 10:25

Lately I have been involved in a couple of projects that have kept me busy and not given me much time to work with Silverlight and WPF so I haven’t been keeping up on the progress of the Expression 3 products release.  Yesterday I was browsing my MSDN subscription for a download and noticed that Expression Studio 3 RTM was on the site for download.  What was even more interesting was that the full studio was available under my VS 2008 Professional MSDN subscription.  Previously only Expression Blend and Expression Web were available.  So, I immediately started the 252 MB download to check it out.

I haven’t had the opportunity to go through the whole Studio but one of the cool things I noticed right away is the new Expression Encoder 3 Screen Capture application.

imageMost of us have used screen capture tools and this particular application is very similar to others.  It can capture the standard screen and mouse movements as well as web cam video and audio.  What is unique is that you can then take the captured footage and directly import it into Expression Encoder with a single click.  From inside Encoder you can then encode the video into a number of previously supported formats such as WMV, or into new formats such as H.264 including both Standard Def. and High Def. qualities.  It also has preset encoding options that allow you to target: Silverlight (IIS Smooth Streaming, etc.), devices (Windows Mobile, Zune, Zune HD, XBOX 360, iPhone, etc.), and online services (YouTube HD/SD, Facebook, Vimeo HD). This is a cool little application and compliments the full Encoder 3 application very well.

Tags: ,

Aug 6 2009

Know Thyself; Know Thy Team

Category: David @ 14:10

One of the most enjoyable aspects of being a Project Architect/Lead, and one which can sometimes be the source of frustration, is being part of a development team.  Any developer that has been part of a team knows that the production of a quality piece of software is affected by numerous factors, not the least of which is team dynamics. Part of being a leader in a team is not only understanding yourself, but also understanding the people on your team and the overall personality and dynamics of the team given the current members.

One of the tools that has been significant in helping me to understand myself, my strengths and weaknesses, has been the Jung/Myers-Briggs personality assessment.  (For those who have never heard of this before you can check it out here and take a quick online assessment hereto find out what your personality type is.)  It has shed light on some of my own behaviors as well as helped me to identify those areas that I struggle with and why I struggle to change in those areas.  As an INFP I have never felt a high level of excitement over administrative tasks.  That does not mean that I can’t develop adequate administrative skills, it just means that I am not going to develop a sense of fulfillment for that type of work nor will it be something that energizes me.  However, as an INFP I am a die hard idealist.  I love to discuss, expound and implement best practices in my software, but have also had to learn to inject myself with a good dose of realism on certain projects.

Understanding the personality types is beneficial in team dynamics and is two fold.  First you need to understand the personalities of each individual on your team. This is necessary so that you can better help them to develop in those areas where they are weak and also, to ensure that the majority of their time is spent on areas that are in alignment with their personality. This helps to ensure that they are energized by their work instead of drained by it.  As a general rule you want to make sure that the members of your team are working about 60-70% of the time in positions or on tasks that line up with their personality type.

For example, you will find that there are some personality types that are less likely to deviate from previously used practices and tend to work within those practices with great satisfaction, efficiency and high productivity.  This type of team member is a great “work horse” that can get a lot of work done as long as the parameters are defined for them and the direction is clear.  On the other hand, this is generally not the type of personality that you want to put on a task that requires a high level of creativity and thinking outside of the box.  Not that they can’t ever do that, but they will tend to not be as satisfied and energized by that work if it takes up the majority of their time.

Secondly, you not only need to understand the individual personalities on your team, but you also need to understand the overall personality of you team.  If you have a large number of Introverts on your team then you may need to focus more explicitly on communication within your team and with the other stake holders on your project.  If you have a high level of personality types with Judging as a strength you may find your team struggles to improvise under certain circumstances.  Ideally the analysis of your team should help you to adjust the makeup of your team (if possible) so that it is well balanced.

With this in mind here are a couple of questions to think about:

  1. Does a persons personality type affect their predisposition to a particular methodology for the Software Development Lifecycle?
  2. How does the overall personality of your team affect your teams success with a given SDL methodology?

Tags: