Reflection

An ability to observe and modify its own structure and behavior at runtime.
  • Computational: observe the state of the program. e.g.
    • Query of the type/size/name of a variable
    • Check the depth of the call stack
    • List fields and methods of an object
  • Structual: modify the state of the program. e.g.
    • Change a class or method definition at runtime
    • Change the maximum allowed depth of the call stack at runtime
    • Turn a string into a function name and call it