A former colleague of mine, Olaf Conijn working with Macaw, has created a very interesting extension to the EntLib configuration manager.
His extension adds an additional property to any configuration node which can be used to give it a “constant name” that will be referencing the string literal.
When saving your configuration it generates a class like this:
//--------------------------------------------------------------
// <autogenerated/>
//--------------------------------------------------------------
public class Constants {
private Constants() {
}
public class ExceptionPolicies {
public const string Database = "database exceptions";
public const string UI = "UI exceptions";
public const string Services = "Service exceptions";
private ExceptionPolicies() {
}
}
}
So your code will not have to rely on the string literals (that might change), but uses the constants class to make this a compile time check.
Ofcourse the names may not be changed during production, but that is already the case with any entlib or aca implementation.
http://spaces.msn.com/members/olafconijn/