The basic principle of object-oriented encapsulation, inheritance, polymorphism, polymorphic mechanism in Java, the expression of variable polymorphism, method polymorphism, which refers to the object belongs to the different classes, and call different class methods; For object methods, there are function overloads, and the signature of functions in Java is determined by the function name + parameter method. Cannot be determined only by a different return value.
Reflective reflect
The runtime gets various properties of the class type, domain, method, and so on.
A class is one that has instances that correspond to other different
(Calculatorimpl) Class.forName ("Calculatorimpl"). newinstance ();
Newinstance () to do the type conversion after the result is obtained.
Cglib bytecode enhancement, "extending Java classes and implementing Java interfaces at runtime", adds that the Java Dynamic Agent mechanism requires the interface to be implemented, while the Cglib targets those classes that do not implement interfaces by inheriting these classes, becoming subclasses, overwriting some methods, So Cglib is not working on the final class.
The byte code Generation Library is the high level API to generate and transform JAVA byte code. It is used by AOP, testing, data access frameworks to generate dynamic proxy objects and intercept field access
"Hibernate Uses cglib to generate proxies for persistent classes.
Dynamic proxy and reflection mechanism in Java