适配器模式 是一种“补偿”模式,通常用来解决接口不相容的问题。分成 类适配器模式 和 对象适配器模式 2种 。
[img]http://dl.iteye.com/upload/attachment/598329/94f0abea-7a6a-3c64-800a-9da4f91c297d.png[/img]
[b]1:类适配器模式[/b]
[img]http://dl.iteye.com/upload/attachment/598331/60b5a8ed-f260-3db9-a5e8-dd7a33cf9c60.jpg[/img]
[b]2:对象适配器模式[/b]
[img]http://dl.iteye.com/upload/attachment/598333/eaf80c5f-87a0-3adc-b4bc-b41c7dde7e4d.jpg[/img]
[img]http://dl.iteye.com/upload/attachment/598329/94f0abea-7a6a-3c64-800a-9da4f91c297d.png[/img]
[b]1:类适配器模式[/b]
[img]http://dl.iteye.com/upload/attachment/598331/60b5a8ed-f260-3db9-a5e8-dd7a33cf9c60.jpg[/img]
[b]2:对象适配器模式[/b]
[img]http://dl.iteye.com/upload/attachment/598333/eaf80c5f-87a0-3adc-b4bc-b41c7dde7e4d.jpg[/img]