An adapter helps two incompatible interfaces, whose inner functionality should suit the need, to work together. The Adapter design pattern achieves this by converting the interface of one class into an interface expected by the clients.
Intent
Convert the interface of a class into another interface clients expect. Adapter lets classes work together that couldn’t otherwise because of incompatible interfaces.
近期评论