First of all, the key difference between a framework and a regular library is called Inversion of Control(IoC). That's an object is typically registered with the framework that takes the responsibility of invoking methods on the registered object at an appropriate time or event. You can only declare your class and config it to the framework by using XML or annotation. Dependency on XML-based metadata and excessive use of reflection and bytecode manipulation may impact application performance . Reflection is one of the most important features of Java and it beneficial for understanding how those popular frameworks work. In brief, Java Reflection provides the following functions:
- Examine an object's class at runtime
- Construct an object for a class at runtime
- Examine a class's field and method at runtime
- Invoke any method of an object at runtime
1. Kayal, Dhrubojyoti. Pro Java EE Spring Patterns: Best Practices and Design Strategies Implementing Java EE Patterns with the Spring Framework. Apress, 2008.
<pre><code> String foo = "bar"; </code></pre>