Skip to content

Proxy Pattern

An object-design pattern in which an interface-compatible surrogate receives a client request, governs or mediates access, and delegates the admissible operation to a real subject.

Version
v1 · 2026-08-30 · History
Domain-specific #
2564
Origin domain
software engineering
Subdomain
object oriented design
Aliases
Object proxy pattern

Core Idea

The Proxy Pattern inserts a surrogate object on the access path to a real subject. Client code addresses the subject interface; a proxy implements that interface, receives the request, applies access, lifecycle, location, or bookkeeping logic, and forwards an admissible operation to the real subject. The GoF formulation calls the proxy a surrogate or placeholder that controls access to another object.

The identity is not “any intermediary.” Interface compatibility lets the proxy stand where the real subject is expected, while a reference or resolution path connects it to that subject. Indirection has an explicit access purpose: deferring expensive construction, crossing a process boundary, enforcing authorization, caching, reference counting, or similar mediation. Variants alter the policy, but preserve the client–proxy–subject role package.

Scope of Application

Remote proxies represent objects in another address space and hide marshalling, transport, and reference management. Virtual proxies postpone creation or loading of expensive objects. Protection proxies check credentials or capabilities before forwarding. Smart references add bookkeeping when a reference is used. Implementations can combine these functions.

The pattern appears in object databases, remote procedure systems, lazy-loading object graphs, graphical resources, access-controlled services, and instrumentation. Its scope does not include every middleware hop. A gateway translating protocols, a message broker decoupling publishers and subscribers, or a service mesh sidecar may have proxy-like aspects, but qualifies here only when the subject-compatible surrogate and controlled-delegation roles are actually present.

Clarity

Use a three-part test. Can the client address the proxy under substantially the same contract as the real subject? Does the proxy identify or resolve that real subject? Does the proxy perform a policy-relevant action on the access path before or after delegation? Three “yes” answers strongly identify Proxy.

Manages Complexity

Proxy localizes access concerns that otherwise spread across clients. Remote clients need not duplicate serialization code. Consumers of a large image need not decide when to load it. Business objects need not embed every authorization check. The subject can remain focused on domain work while the proxy owns the cross-cutting access policy.

Abstract Reasoning

The role package predicts design consequences. Because the proxy and real subject share a contract, clients can often be configured with either. Because every request crosses the proxy, it forms an enforcement or observation point. Because the proxy may resolve the subject lazily, construction can move from configuration time to first use.

Knowledge Transfer

The literal pattern transfers among graphical applications, enterprise systems, distributed objects, persistence layers, and security wrappers. The subject contract, surrogate, policy, and delegation roles remain stable while technologies change.

Beyond software, an authorized representative may mediate access to a principal, but object identity, interfaces, and delegation semantics do not transfer literally enough to classify those arrangements here. Their shared residue belongs to Interface, Intermediation, Substitutability, and Delegation-like catalog structures.

Relationships to Other Abstractions

Local relationship map for Proxy PatternParents appear above the current abstraction, mutual partners to the right, and children below. Node labels state whether each abstraction is prime or domain-specific; colors identify relation types.Proxy PatternDOMAINPrime abstraction: Design Patterns — is a kind ofDesign PatternsPRIME

Current abstraction Proxy Pattern Domain-specific

Parents (1) — more general patterns this builds on

  • Proxy Pattern is a kind of Design Patterns Prime

    Proxy is a strict specialization of prime:design_patterns, the minimal proposed parent.

Hierarchy path (1) — routes to 1 parentless root

Neighborhood in Abstraction Space

Proxy Pattern sits in a sparse region of the domain-specific corpus (86th percentile for distinctiveness): few abstractions share its structure, so a faithful description tends to retrieve it precisely.

Family — Unclustered & Miscellaneous (1565 abstractions)

Nearest neighbors

Computed from structural-signature embeddings · 2026-09-08