The Adapter Pattern converts the interface of a class into another interface the clients expect.Adapter lets classed

work together that couldn't otherwise because of imcompatible interfaces.

Head First Design Patterns - Adapter Pattern

Object and class adapters

class diagram

Head First Design Patterns - Adapter Pattern

The only difference is that with class adapter we subclass the Target and the Adaptee, while with object adapter

we subclass we use composition to pass requests to an Adaptee.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-08-20
  • 2021-11-11
  • 2021-06-24
  • 2021-05-20
  • 2021-10-26
  • 2021-09-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案