Design Pattern: Proxy versus Adapter

Connect with

Proxy vs Adapter Design PatternLearn Proxy vs Adapter design patterns, structurally both are same but intent of both are different. Let me explain the similarity and differences between them.

Overview of proxy vs Adapter

The intent of both proxy and adaptor are different, however,structure seems similar but same. Let me explain different apects of Adapter design pattern and proxy design pattern

1. Proxy Design Pattern

control Access to it.

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. Visit Proxy design pattern for more details.

2. Adapter Design Pattern

Make 2 different interface compatible

Adapter change the Interface , it mean make the 2 different interfaces compatible.

3. Key Points of considerations

The following are the key points for high level things in Proxy and adapter design pattern.

  • The Proxy changes the behavior of the Service but preserves its interface while The Adapter changes the interface of the Service, but preserves it behavior.
  • Proxy does not process the request directly , target object process the request while Adapter also does not process request directly it redirect to Adaptee and process request via Adaptee only.
  • Proxy add additional layer to design while Adapter also add additional layer to design.

4. Reference

I hope you enjoyed this post of proxy design patterns, and you can visit design patterns tutorial for more details.
Suggestions are welcome to improve this post. Happy Learning 🙂

Connect with

Leave a Comment

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