Someone asked on the Microsoft Web Dev. mailing list the other day about how they could remove their hardcoded loading of messages from their resource manager in .NET. They were doing it using some code like this-
System.Reflection is one of the greatest advantages to writing managed code, and can definetly boost development productivity. For example, using reflection you could get the personal error message from the resource manager using this-
Providing the exception thrown was of type ‘ClassNotFound’, the above code would be effectively doing the same as the first piece of code, but without the necessity to hardcode strings.
I intend to write more stuff about the wonders of reflection in the future.