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.

posted @ 2012-04-24 16:01  qiangzhu  阅读(497)  评论(0编辑  收藏  举报