Proxy means agent and refers to a person who performs work in place of someone else. When the work does not necessarily need to be done in person, an agent can be found to do it.
In the agency model, however, it is often the other way around; usually the agent comes across the work and leaves it to the object being represented, with the agent only doing some preparatory or closing work.
If the reader understands the spring framework, then you will know that aop is also cutter-oriented programming is actually using the dynamic proxy pattern, which allows the proxy object to focus on completing their own work, while the proxy object can work before the logging, time calculations, logging after the work, closing work and other additional functions that need to be done formally when the work is left to the proxy to do. It's like sticking two knives into the front and back of this proxied object. So the image is called cut-oriented programming.
For more information on the dynamic and static proxy patterns, interested readers can refer to another blog post by the author at
Java dynamic vs. static proxieshttp://www.jianshu.com/p/b5e340ec9551
Example program for the proxy model
We'll implement a printer that prints a string to the screen, and then hand off to a proxy object to do that.