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

What are the benefits of the proxy in the design pattern?

592


Shall we use abstract classes or interfaces in policy / strategy design pattern?

594


What is the executor design pattern?

721


Why is singleton used?

623


Which design patterns have you used in your project ?

564






2. Create your own definition of a system. Based on the “system” definitions a. Identify your viewpoint of shortcomings in the definitions. b. Provide rationale as to why you believe that your definition overcomes those shortcomings. c. From an historical perspective, identify three precedented systems that were replaced by unprecedented systems.

2718


What is the behavioral design pattern?

657


What is difference between function oriented design and object oriented design?

590


What is the difference between factory and strategy design pattern?

539


What is a lazy initialization in singleton?

593


Why have we declared the instance reference volatile?

536


Is singleton bean thread safe?

553


Which design pattern is mvc?

620


Contact a system development program in your organization. Research how they analyzed their SYSTEM OF INTEREST (SOI), its OPERATING ENVIRONMENT, and their respective system elements. How was this analysis reflected in the SOI architecture?

3624


Are you using singleton in your code?

587