Reflection API
Reflection Api allows the developer to inspect and manipulate classes, methods and fields and other components of a Java program at runtime. Additionally developers can instantiate new object, invoke methods, access and modify fields dynamically using Reflection API.
Reflection is used in
- Building generic tools that operate on arbitrary types
- Building frameworks like Object Relational Mapping (ORM), Serialisation, Dependency Injection.
- Developing, debugging and testing tools that need to modify a programs behaviour at runtime.
While reflection provides powerful capabilities, it should be used judiciously due to its potential performance overhead and complexity.
Comments
Post a Comment