what is the difference between the Adapter Pattern and Proxy Patterns?its seems both are almost similar?

Answer Posted / ravis190784

Comparing Adapter Pattern with other Patterns:

1. Adapter converts one interface to another, Decorator doesn't alter interface but adds responsibility. Facade makes an interface simpler.
Decorator is thus more transparent to the application than an adapter is. As a consequence, Decorator supports recursive composition, which isn't possible with pure Adapters.

2. Adapters allows client to make use of libraries and subsets without changing any code. Decorators allow new behaviour to be added to the classes with out altering the existing code.

3. Adapter make things work after they're designed, Bridge makes them work before they are.

4. Bridge is designed up-front to let the abstraction and the implementation vary independently. Adapter is retrofitted to make unrelated classes work together.

5. Adapter provides a different interface to its subject. Proxy provides the same interface. Decorator provides an enhanced interface.

6. Facade defines a new interface, whereas Adapter reuses an old interface. Remember that Adapter makes two existing interfaces work together as opposed to defining an entirely new one.

Is This Answer Correct ?    16 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write the code for a singleton class?

798


Give me example of observer design pattern?

825


What are the main usage of the patterns?

818


What are the design patterns you know explain?

830


Can we have this pattern implemented using static class?

793


Is bean a singleton?

730


Quartus II software version 6.0 is available for which operating systems (OS)?

2147


What are the disadvantages of singleton pattern?

802


What are the types of the proxy design you will get in the design pattern?

737


Which design pattern is mvc?

802


Hi, I have 9backlogs in btech and i am 2008 passed out,am working with an MNC from past 3 years.now, am willing to do MS, will it be any problem for me?

2873


Is mvc a software design pattern?

887


What are the examples of the behavioral design patterns?

810


What is the difference between factory and strategy design pattern?

749


What are the SDLC phases you have invloved ?

2402