Dynamic Strongly-Typed Configuration in C#

Posted on 29/06/2007.

I thought it was worth describing this configuration solution, since it was so neat, and easy, and had all of the benefits of text based configuration and strongly typed inline configuration.

Read Full Post | Make a Comment ( 2 so far )

Why type safety in configuration is a good thing

Posted on 1/11/2006.

How many times have you seen a piece of code like this?
bool shouldUseXyzService = bool.Parse(WebConfiguration.AppSettings["shouldUseXyzService"]);
if(shouldUseXyzService){…}
It’s a familiar thing to most programmers. And most programmers never stop to think about just how evil it is. In my last few posts I’ve been suggesting that we ought to be using something like this:
if(SomeConfiguration.ShouldUseXyzService){…}
Why is it better?
Type Safety.
The [...]

Read Full Post | Make a Comment ( None so far )

Liked it here?
Why not try sites on the blogroll...