适配器模式(Adapter)-对象结构型模式
2009-11-24 19:34
260 查看
将一个类的接口转换成客户希望的另外一个接口。Adapter模式使得原本由于接口不兼容而不能一起工作的那些类可以一起工作。
适配器模式有两种典型的结构类型,即类的适配器模式结构和对象的适配器模式结构。
类的适配器模式的结构类图如下:
![](http://p.blog.csdn.net/images/p_blog_csdn_net/zhangzhaokun/EntryImages/20091124/Class适配器模式.jpg)
对象的适配器模式的结构类图如下:
适配器模式有两种典型的结构类型,即类的适配器模式结构和对象的适配器模式结构。
类的适配器模式的结构类图如下:
![](http://p.blog.csdn.net/images/p_blog_csdn_net/zhangzhaokun/EntryImages/20091124/Class适配器模式.jpg)
对象的适配器模式的结构类图如下:
![](http://p.blog.csdn.net/images/p_blog_csdn_net/zhangzhaokun/EntryImages/20091125/object适配器模式.jpg)
相关文章推荐
- 适配器模式(Adapter Pattern 类对象结构型模式)
- 对象结构型模式——适配器模式(adapter)
- 适配器模式(Adapter)(对象结构型模式)
- 适配器模式(Adapter Pattern 类对象结构型模式)
- 7种结构型模式之:适配器模式(Adapter):类适配器、对象适配器
- (第Ⅲ部分 结构型模式篇) 第7章 适配器模式(Adapter Pattern)
- 23种设计模式(6)_结构型_适配器模式(Adapter Pattern)
- 设计模式 一 适配器模式 Adapter(结构型模式)
- [设计模式](五):适配器模式(Adapter)[类适配器、对象适配器、接口适配器]
- 设计模式(8)の结构型の适配器模式(Adapter)
- 结构型模式之适配器模式(Adapter)
- 设计模式(五)适配器模式Adapter(结构型)
- 设计模式(五)适配器模式Adapter(结构型)
- 设计模式七:Adapter(适配器)——类对象结构型模式
- 适配器模式(类对象结构型模式)
- 白话设计模式--结构型模式之 适配器模式(Adapter)
- 结构型模式-Adapter ( 适配器模式 )
- [设计模式笔记]二. 结构型模式--7.Adapter模式(适配器模式)(一)
- "围观"设计模式(11)--结构型之适配器模式(Adapter Pattern)
- 设计模式(五)适配器模式Adapter(结构型)