I am very confused about Adapter and Delegation design pattern. In Adapter pattern we bring an intermediate class to interact with another class. And in Delegation pattern we also bring an intermediate class to refer/interact with another class.

  • 3
    what is that you specifically find confusing in Wikipedia articles on Adapter and Delegation patterns?
    – gnat
    Dec 22, 2015 at 21:36

1 Answer 1


Structurally the two patterns are similar. But remember that design patterns are meant to be solutions to specific problems. The problems that Adapter and Delegation solve are quite different.

A typical problem for Delegation is when you go to implement a class, and realize that part of the implementation is quite complicated, and having a helper object to encapsulate a particular chunk of the implementation logic would make things significantly more readable.

A typical problem for Adapter is when you have two classes that do the same thing, but with different interfaces, yet you want your code to be able to work with both. So you decide which interface is better for your purposes, then write an adapter around the other class so that you can use it as if it had the better interface all along.

  • Thanks for your reply. But what I am thinking is, we are hiding class from the client with the help of intermediate class. But that could be done by the client and target class direct interaction ? Dec 22, 2015 at 21:50
  • @MuztabaHasanat Yes. Normally you would just let your "real" classes talk to each other directly. These patterns should only be introduced when you have a problem that they happen to solve.
    – Ixrec
    Dec 22, 2015 at 21:57
  • Is it valid to also say that the delegator class will always have that extra logic wrapping the delegate, and that the adapter class will not (i.e. since it's only exposing a new interface)? Jul 26, 2021 at 21:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.