Head First Design Patterns - Adapter Pattern
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.

Object and class adapters
class diagram

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.
浙公网安备 33010602011771号