Programming with Metadata
The previous section ended with an example that displayed a list of types a given object was compatible with. That example is just the tip of the iceberg of what is possible when type definitions are made machine-readable. This facility is often called reflection, a term made popular by Java.
Reflection makes all aspects of a type's definition available to programs, both at development time and at runtime. Although reflection is useful for building highly dynamic systems, it is far more applicable as a development-time tool. The primary application for reflection is for code generation. Code generation is typically thought of as a development-time activity, and reflection is useful in this capacity. However, even systems ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access