The Proxy Pattern

archetype Social RolesObject-Oriented Design

Categories: software-engineering

What It Brings

A proxy is someone authorized to act on your behalf: a legal proxy votes at a shareholders’ meeting, a diplomatic proxy negotiates a treaty, a proxy bidder raises the paddle at auction. The principal is absent, but their authority is present through the stand-in. The GoF Proxy pattern maps this onto software: a proxy object stands in for another object, controlling access to it while presenting the same interface.

Key structural parallels:

Where It Breaks

Expressions

Origin Story

The proxy concept in software predates its GoF codification. Remote procedure call systems in the 1980s (Sun RPC, Xerox Courier) used “stub” objects that acted as local stand-ins for remote services. The stubs were proxies in everything but name.

The GoF formalized the pattern in Design Patterns (1994), drawing explicitly on the social and legal metaphor. They distinguished three variants: remote proxy (representing an object in another address space), virtual proxy (creating expensive objects on demand), and protection proxy (controlling access rights). Each variant maps cleanly to a different social scenario: the diplomatic envoy, the advance team, and the bodyguard.

The proxy metaphor then expanded far beyond OOP. HTTP proxy servers, proxy design in distributed systems (Java RMI, CORBA), and modern API gateways all use the term. In each case, the core social structure persists: one entity acts on behalf of another, presenting a compatible face to the world while adding a layer of indirection. The pattern’s name has proven durable because the social metaphor is immediately intuitive, even to developers who have never appointed a legal proxy.

References

Related Mappings