Home  >  Article  >  Java  >  Graphical example of dynamic proxy inheritance

Graphical example of dynamic proxy inheritance

零下一度
零下一度Original
2017-06-25 10:29:581962browse

The answers online are varied and ambiguous. None of them are as realistic as this picture, simple and clear;

Dynamic proxy inheritance diagram

##And this rule specification applies to all proxy classes created by Proxy.

The proxy classes actually inherit the Proxy class--------because java does not support multiple inheritance. So. . .

-------------------------------------------------- ----------------------------------------

ps:

If you want to solve the direct proxy of the class. Then you need to use Cglib.

The principle of Cglib is to use the target class to be proxied as the parent class, and the subclass overrides the parent class method. Subclass pseudo code:

public void find(){

syso("I want to enhance!");

target.find();

}

The above is the detailed content of Graphical example of dynamic proxy inheritance. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn