Wednesday 15 March 2017

Java reflection

Reflection in Java is a very powerful concept and it’s of little use in normal programming but it’s the backbone for most of the Java, J2EE frameworks. Some of the frameworks that use java reflection are:
JUnit – uses reflection to parse @Test annotation to get the test methods and then invoke it.
Spring – dependency injection, read more at Spring Dependency Injection
Tomcat web container to forward the request to correct module by parsing their web.xml files and request URI.
Eclipse auto completion of method names
Struts
Hibernate
The list is endless and they all use java reflection because all these frameworks have no knowledge and access of user defined classes, interfaces, their methods etc.


http://www.journaldev.com/1789/java-reflection-example-tutorial#reflection-in-java