Proxy pattern for the instance of the. NET design pattern (proxy patterns)

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.