Before connecting the topics of reflection and attributes in the next sections, it’s worth exploring what the reflection classes have to offer by themselves.
Reflection refers to techniques a program can use to obtain more information about classes, analyze classes, and create class instances programmatically.
Of course, the latter is no great feat. After all, you do it all the time by using the constructor of a class. But that’s not what this is about. The goal here is to be able to use classes that your program is unaware of when you start it.
For example, assume that you need to provide a function that accepts an arbitrary object as a parameter and returns the value of each property of that object on the screen. Normally, ...