Design Pattern : Proxy Versus Facade

Connect with

proxy vs facade design patternsLearn Proxy vs Facade design patterns, structurally both are same but intent of both are different. Let me explain the similarity and differences between them.

1. Proxy Design Pattern

provides a surrogate or placeholder for an object to control access to it

What is proxy?

It’s an intermediary between a client object and the target object. responsibility wise it, It receives a call from client object and forwards them to the target Object. Proxy design pattern

2. Facade Design Pattern

Facade object provides simplified higher level interface to a subsystem

3. Key Points of Proxy vs Facade

The Proxy design pattern and Facade design pattern are most important. I tried to basic compare

  • The purpose of the Proxy is to add behavior while The purpose of the Facade is to simplify, which may actually involve removing behavior.
  • Proxy object represents a singly object while Facade object represents a subsystem of object.
  • The client object cannot access target object directly while client object does have ability to access subsystem object.
  • Proxy object provides access control to the single target object while Facade object provides simplified higher level interface to a subsystem of objects/components.

4. Reference

I hope you enjoyed this post of proxy vs Facade design patterns, and you can visit design patterns tutorial for more details
Please write your comment to improve this post. Happy learning 🙂

Connect with

Leave a Comment

Your email address will not be published. Required fields are marked *