Introduction of Agent Mode (Brief Introduction)
Proxy pattern provides a proxy for other objects to control access to this object.
Ii. issues addressed (What to Solve)
1. Remote Agent
Remote proxies, which provide local representation for an object in a different address space. This hides the fact that an object exists in a different geologic space and hides the address space of the object.
For example,. Net Web Service, when a project joins a Web reference, references the Web service, generates a WebReference folder and response file in the project, and these folders and files are proxies, and the client is tuning The problem of remote access has actually been resolved with this agent.
2. Virtual Agent
Virtual proxies, which create expensive objects as needed. It is used to store real objects that can take a long time to instantiate. This can achieve the optimal performance.
For example, browser using proxy mode to optimize the download of the Web page, that is, the first display of Web page text, pictures need a piece of the underground to see.
3. Security Agent
A security agent that controls the permissions for real object access. Typically used when an object should have different access rights.
4. Intelligent guidance
Intelligent guidance refers to the agent handling other things when the real object is invoked. For example, before accessing an actual object, check to see if it has been locked to ensure that other objects cannot change it. That is, some housekeeping that is attached when accessing an object.
Agent Mode Analysis 1, agent mode structure