Reflection is a way of finding out information about the structure of an object. In other words, we can find out information about what fields, methods, properties, events etc. it contains, usually including names and types. Once we have this information, we need to be able to use it, so in .NET, we have methods for accessing all these things via reflection.
The point in this is that we can write reusable code that can be very generalised to work across all sorts of different classes. This can save us a lot of time in the long run and it often makes the code a lot neater. I quite often find that reflection can save me time even in the short run, so it is well worth the investment of time in learning how to use it.
- On Reflection Part 1: What is Reflection?
- On Reflection Part 2: GetType
No related posts.
Tags: .NET, Coding, Object Orientation, Solutions












[...] This returns a reflection object representing the method that the exception occurred within. I’ve not actually found [...]