Today I Learned

TIL, 2022-03-31, Adapter Pattern

Adapter Pattern — What It Is and How to Use It?

Reference

  • Adapter pattern = structural pattern - converts the interface of a class into another interface the clients expect.
  • When to use it?
    • When we are working with two incompatible systems or classes or interfaces, the adapter pattern can be very powerful to use. It makes the code simpler, consistent, and easy to reason about.
    • Whenever we have several objects or methods doing something but have different implementations or different syntaxes, an adapter pattern can definitely be a good option.

This project is maintained by daryllxd