Sunday, April 6, 2008

Better than a Production Break

I was just watching the Editing Data and Making Forms ASP.NET MVC screencast by Scott Hanselman and heard him say "a broken build is better than a production break." This is the first time that I've heard this quote although I have no doubt that it's not new.

The cool thing about the code that he is showing at this point in the screen cast is how URL's can be removed as strings in ASP.NET MVC and can instead be defined as ActionLinks to strongly typed objects and using the new C# 3.0 lambda expressions "discover" the correct URL.

This means that if your URL is going to change it will happen to the strongly typed object which will break the build. Breaking the build is great because you can fix it then and there before it goes to production.

If you are using strings to describe your URL then when you make a change to the URL you will need to replace all of the strings in that URL. If you miss one then you won't know about it at compile time. It will only become apparent at run time and that might be in production if it's not caught in the test environment.

No comments:

Post a Comment