Hacker News new | ask | show | jobs
by robbbbbbbbb 3656 days ago
Reflection is the concept of having a program have knowledge about it's own structure. Kinda like having your code look into a mirror.

A really basic example of this is having you code get a list of all the names of fields of a class. This would be very useful if you want to create a generic object serializer.

In the past I used this to create a framework that would generate a UI for you based on class definitions.

Reflection can also include being able to modify your own code structure during run time.

1 comments

Great explanation, thanks.