Adapter Pattern vs Facade Pattern
- Facade defines a new interface, whereas Adapter uses an old interface. Remember that Adapter makes two existing interfaces work together as opposed to defining an entirely new one.
- Adapter and Facade are both wrappers, but they are different kinds of wrappers. The intent of Facade is to produce a simpler interface, and the intent of Adapter is to design an existing interface. While Facade routinely wraps multiple objects and Adapter wraps a single object; Facade could front-end a single complex object and Adapter could wrap several legacy objects
Adapter Pattern vs Decorator Pattern
- main difference is that:
- the decorator pattern is used to add functionality to an object at run-time without changing the object's method signature(s)
- the adapter pattern is used to change the interface of an object to adapt it to another interface (i.e. different method signature(s))
- The decorator pattern is similar to the adapter pattern in that one service "wraps" another. However, in contrast to adapters, decorators expose the same service as what they're decorating.