Cognitive Scaffold

Preparing your thinking workspace

arrow_back_ios_new
MENTAL MODEL · M0544

Proxy Pattern

Proxy Pattern
CreateHigh supportDesign Thinking
Included
account_tree

Updated 2026-07-30

Loading revision record…

Summary

The proxy pattern is a design pattern in programming. A proxy, in this context, refers to a class that can serve as an interface to something else. A proxy can act as an interface to anything: network connections, large objects in memory, files, or other resources that are expensive or impossible to duplicate.

Definition

Provide a surrogate or placeholder for another object to control access to it. Scaffold use: Control access and enhance functionality. A secretary is a proxy for the CEO; a CDN is a proxy for the server. As a scaffold, it teaches us to establish a 'buffer' between core resources and external requests: performing permission control, cache acceleration, or logging to protect the core from direct impact.

How to use

Control access and enhance functionality. A secretary is a proxy for the CEO; a CDN is a proxy for the server. As a scaffold, it teaches us to establish a 'buffer' between core resources and external requests: performing permission control, cache acceleration, or logging to protect the core from direct impact.

Mechanism

Insert a proxy object between the client and the target object, with the proxy intercepting and controlling access to the real object. The proxy can add enhanced logic such as permission checks, caching, logging, or lazy loading before and after forwarding requests; the real object remains transparent to the client, which believes it is interacting with the real object, but all calls are actually routed through the proxy.

Practice

In progress 0/4

Practice this model in one real situation:

Check to track your progress (stored locally)
Learning progress0%

Cases

  • A secretary acts as a proxy for the CEO to filter visitors and schedule; a CDN acts as a proxy for the origin server to cache static resources for faster access; front-end uses virtual proxy to delay creation of large objects (e.g., image lazy loading).

Common pitfalls

  • Treating the proxy as a pure transparent forwarder, forgetting its 'control and enhancement' purpose, leading to the proxy accumulating unrelated logic and becoming a god object; or overusing proxies, increasing call layers and latency.
Sources

Source support: Explicit

References currently contain only Wikipedia links; primary sources still need review.

  • link
    zh.wikipedia.orghttps://zh.wikipedia.org/wiki/%E4%BB%A3%E7%90%86%E6%A8%A1%E5%BC%8FZH · Explicit
    verified
account_treeGenealogyexpand_more

RELATED MODELS