What are the differences between proxy, wrapper or a façade classes
Master System Design with Codemia
Enhance your system design skills with over 120 practice problems, detailed solutions, and hands-on exercises.
Introduction
Proxy, wrapper, and façade classes all stand between client code and some other object or subsystem, which is why they are easy to confuse. The difference is in intent. A proxy controls access to a target, a wrapper surrounds an object to adapt or augment it, and a façade provides a simpler entry point into a more complex subsystem.
Proxy: same role, controlled access
A proxy usually presents the same interface as the real object. The client talks to the proxy as if it were the target, and the proxy decides how or when to forward the call.
Typical reasons to use a proxy include:
- Lazy initialization
- Access control
- Caching
- Logging or remote indirection
Here the proxy controls when the expensive real object is created. The client still works with the Image interface and does not need to know whether it received a proxy or the real image.
Wrapper: a broad term for surrounding an object
"Wrapper" is more of a general description than a precise Gang of Four pattern name. A wrapper class surrounds another object and changes how you interact with it. That change may be about safety, convenience, validation, or interface adaptation.
This wrapper does not exist mainly to control access like a proxy. It exists to add a more convenient and safer way to write lines. In everyday conversation, many decorators and adapters are also casually called wrappers because they wrap another object.
Façade: simpler interface to a subsystem
A façade is different from both proxy and wrapper because it is not mainly about one target object. It gives the client a simplified front door to a set of collaborating classes.
The client calls one method on OrderFacade instead of coordinating several subsystem services directly. That is the hallmark of a façade: simplify a complex set of steps.
How to tell them apart quickly
A useful checklist is:
- If the class stands in for the same interface and controls access, think proxy.
- If the class surrounds another object to add convenience, safety, or adaptation, think wrapper.
- If the class simplifies a larger subsystem behind one small API, think façade.
These ideas can overlap in real code, but the primary intent usually makes the pattern clear.
Common Pitfalls
The biggest mistake is classifying every forwarding class as a proxy. Delegation alone does not define the pattern; intent does.
Another issue is treating "wrapper" like a precise formal pattern when it is often just a broad descriptive term. A wrapper might behave like a decorator, adapter, or some custom helper.
Developers also confuse façade with proxy because both stand in front of something else. The difference is scope. A proxy usually fronts one target object, while a façade usually fronts a subsystem.
Finally, avoid adding these layers without a reason. Extra indirection is only useful when it makes access control, simplification, testing, or maintenance genuinely better.
Summary
- A proxy controls access to a target object, often through the same interface.
- A wrapper surrounds an object to adapt, simplify, or augment its behavior.
- A façade gives clients a simpler API over a more complex subsystem.
- Delegation alone does not tell you which pattern you have; intent does.
- Choose the pattern that matches the problem, not the one with the most impressive name.

