definition
Name: Proxy structure: intent: Provide a proxy for other objects to control access to this object. Applicability: Use the Proxy mode when you need to use a relatively universal and complex object pointers instead of a simple pointer. Here are some common situations where you can use the Proxy mode:
1. Remote Agent provides a local area representative object for an object in different address spaces. This different address space can be in this machine, or in another machine. The remote agent is also called Ambassador.
2, Virtual Agent, create a large number of resources consumed as needed, so that this object is only true when needed.
3, a Copy-on-Write agent, a virtual agent. Take actions when you delay the replication (clone) to only when you need it.
4, Protect or Access proxy, control access to an object, if you need to provide different levels of use permissions to different users.
5. Cache proxy provides temporary storage space for the results of a target operation so that multiple clients can share these results.
6, firewall agents, protective goals, do not allow malicious users close.
7. Synchronization proxy makes several users to use an object simultaneously without conflict.
8. Smart Reference Agent When an object is referenced, some additional operations are provided, such as the number of times the object calls will be recorded.
In all types of proxy mode, virtual (Virtual) agent, Smart Reference Proxy and Protection (Protect Or Access) is the most common type of proxy mode.
effect:
Classic Case
1. Java RMI stub, EJBOBJECT JAVA RMI (Remote Method Invocation) is a referusion of a remote method call, which greatly enhances the ability of Java development distributed applications.
2, JIVE rights system
Best Practices
1,
Related mode
1,
Reference article
1,
http://www.jdon.com/designpatterns/designpattern_proxy.htm
2,
http://blog.9cbs.net/lxwde/archive/2004/08/06/6688.aspx
3, proxy mode (宏)
http://www.ttian.net/Article/show.php?id=219