说说设计模式~适配器模式(Adapter)
之前和大家一起谈了工厂模式和单例模式,今天来看一下另一种非常常用的模式,它就是适配器模式,第一次看到这个模式是通过“张逸”老师的“设计之道”这篇文章,在这里表adapter讲的很透彻,今天把张老师的文章拿过来,分享给大家!
何时能用到它?
对于一个软件生产商A来说,在过去的20年里,它们主要生产收音机,包括最早的老式半导体和现代的数字收音机,总之,是收音机。但不知道从什么时候开始,MP4媒体播放器出现了,这使得A生产商不得不去招新人,去生产适合大家的mp4播放器,这东西很好,能听音乐,看电影,比20年前的收音机好多了!
正在A生产商洋洋得意时,突然有个客户投诉他们,说你们的东西为何没有收音机的功能,我想叫广播!这下可让A生产商发愁了,它马上找到了公司的技术总监,CTO是个很厉害的岗位,它们无所不能,只要你有需求,我们就可以给你实现!CTO是如何让mp4播放器具体收音机功能的呢?大家继续看
适配器模式的结构图
aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAnAAAAIbCAIAAADkQjRtAAAgAElEQVR4nO3d63MTd57v8Z6a83fs1m7VyfwRh+JS8T7M0yQPk4nBJgw2HDKBYRx2WcAmyImdGBPIcGDDQCBkuC0XUUMSnJ2Y2CQQB7AtW5J1sXyTJVvXbt0snQctt2WpLcnQQq3W+1XfmpKFYTTD7/P79EUWQgYAALwwodovAAAAI6BQAQDQAIUKAIAGKFQAADRAoQIAoAEKFQAADVCoAABogEIFAEADFCoAABqgUAEA0ACFCgCABihUAAA0QKECAKABChUAAA1QqAAAaIBCBQBAAxQqAAAaoFABANAAhQoAgAYoVAAANEChAgCgAQoVAAANUKgAAGiAQgUAQAMUKgAAGqBQAQDQAIUKAIAGKFQAADRAoQIAoAEKFQAADVCoAABogEIFAEADFCoAABqgUAEA0ACFChjB3OyM1WoRxWi1XwhQvyhUoLZ9c+/O7tbGjva23h7T/n0tHe1tToe92i8KqEcUKlCrRDHa3dV+6+aV3CfnZme6u9q/uXenWq8KqFsUKlCrzn3x+eNHg6q/dOpk9+jI08LnhdXynin535j3beX8FqB+kAegJj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VCoAABogEIFAEAD/x9ZV6KSDakNdgAAAABJRU5ErkJggg==" alt="" />
适配器模式实现说明
媒体播放接口IMedia
视频实现抽象类VideoMedia
音频实现抽象类AudioMedia
mp4播放器实现类:mp4Media和mp3Media,可能还有FlvMedia等
收音机接口IRadio
收音机抽象类Radio
收音机FM调频实现类FmRadio
收音机FM调频与媒体播放器的适配器FmAdapter
适配器模式的C#实现
#region adapter[播放器适配器]
#region 媒体播放器
interface IMedia
{
void Play();
void Stop();
void Next();
void Prev();
void Pause();
void OpenFile();
void CloseFile();
}
abstract class AudioMedia : IMedia
{
public virtual void Play()
{
throw new NotImplementedException();
} public void Stop()
{
throw new NotImplementedException();
} public void Next()
{
throw new NotImplementedException();
} public void Prev()
{
throw new NotImplementedException();
} public void Pause()
{
throw new NotImplementedException();
} public void OpenFile()
{
throw new NotImplementedException();
} public void CloseFile()
{
throw new NotImplementedException();
}
}
abstract class VideoMedia : IMedia
{
public virtual void Play()
{
throw new NotImplementedException();
} public void Stop()
{
throw new NotImplementedException();
} public void Next()
{
throw new NotImplementedException();
} public void Prev()
{
throw new NotImplementedException();
} public void Pause()
{
throw new NotImplementedException();
} public void OpenFile()
{
throw new NotImplementedException();
} public void CloseFile()
{
throw new NotImplementedException();
}
}
class Mp3Media : AudioMedia
{
public override void Play()
{
base.Play();
Console.WriteLine("播放mp3");
}
}
class Mp4Media : VideoMedia
{
public override void Play()
{
base.Play();
Console.WriteLine("播放mp4");
}
}
#endregion
#region 收音机
interface IRadio
{
void Receive();
void Stop();
void TurnOn();
void TurnOff();
void Change(bool direction);
}
abstract class Radio : IRadio
{
public virtual void Receive()
{
throw new NotImplementedException();
} public void Stop()
{
throw new NotImplementedException();
} public void TurnOn()
{
throw new NotImplementedException();
} public void TurnOff()
{
throw new NotImplementedException();
} public virtual void Change(bool direction)
{
throw new NotImplementedException();
}
}
class FmRadio : Radio
{
public override void Receive()
{
base.Receive();
Console.WriteLine("接口FM频段");
}
public override void Change(bool direction)
{
base.Change(direction);
Console.WriteLine("改变FM频段");
}
}
#endregion
#region 收音机到媒体播放器的适配器
class FMAdapter : Radio, IMedia
{
//! 适配器通过Radio去实现了IMedia接口 public void Play()
{
base.TurnOn();
base.Receive();
} public void Stop()
{
base.TurnOff();
} public void Next()
{
base.Change(true); } public void Prev()
{
base.Change(false);
} public void Pause()
{
throw new NotImplementedException();
} public void OpenFile()
{
throw new NotImplementedException();
} public void CloseFile()
{
throw new NotImplementedException();
}
}
#endregion
#endregion
这样我们就实现了Radio与Media两大对象的联系,而这种联系是在不破坏对象本身的基础上实现的,这种实现的过程就是适配器模式实现的过程!
感谢GOF,感谢张逸老师!
说说设计模式~适配器模式(Adapter)的更多相关文章
- 设计模式 - 适配器模式(adapter pattern) 具体解释
适配器模式(adapter pattern) 详细解释 本文地址: http://blog.csdn.net/caroline_wendy 适配器模式(adapter pattern): 将一个类的接 ...
- 设计模式 - 适配器模式(adapter pattern) 枚举器和迭代器 具体解释
适配器模式(adapter pattern) 枚举器和迭代器 具体解释 本文地址: http://blog.csdn.net/caroline_wendy 參考适配器模式(adapter patter ...
- 设计模式--适配器模式Adapter(结构型)
一.适配器模式 适配器模式的主要作用是在新接口和老接口之间进行适配.将一个类的接口转换成客户端期望的另外一个接口.其实适配器模式有点无赖之举,在前期设计的时候,我们就不应该考虑适配器模式,而应该通过重 ...
- [工作中的设计模式]适配器模式adapter
一.模式解析 适配器模式把一个类的接口变换成客户端所期待的另一种接口,从而使原本因接口不匹配而无法在一起工作的两个类能够在一起工作. 也就是说,如果已经写好了一个接口,但是又来了一种截然不同的接口,如 ...
- C#设计模式——适配器模式(Adapter Pattern)
一.概述在软件开发中,常常会想要复用一个已经存在的组件,但该组件的接口却与我们的需要不相符,这时我们可以创建一个适配器,在需复用的组件的接口和我们需要的接口间进行转换,从而能够正常的使用需复用的组件. ...
- 设计模式-适配器模式(Adapter)
简介: 适配器模式在我看来是最无聊的一种模式,因为他根本不是一种新的创意模式,而是一种不得已而为之的模式.就算不学适配器模式,在具体应用场景中也会自然而然的想到这种解决方案. 张三在英国留学时买了个笔 ...
- 大话设计模式--适配器模式 Adapter -- C++实现实例
1.适配器模式: 将一个类的接口转换为客户希望的另一个接口,使得原来由于接口不能一起工作的那些类一起工作. 适配器模式一般用于希望复用一些现存的类,但是接口又与复用环境要求不一致的情况. 适配器模式分 ...
- [设计模式]适配器模式Adapter
将一个类的接口转换成客户希望的另外一个接口. A d a p t e r模式使得原本 由于接口不兼容而不能一起工作的那些类可以一起工作.
- 设计模式(五)适配器模式Adapter(结构型)
设计模式(五)适配器模式Adapter(结构型) 1. 概述: 接口的改变,是一个需要程序员们必须(虽然很不情愿)接受和处理的普遍问题.程序提供者们修改他们的代码;系统库被修正;各种程序语言以及相 ...
随机推荐
- [django]在virtualenv下安装的第三方库的使用方法
在virtualenv下安装的第三方库,例如south, requests等,如果想在django中使用,需要先将库添加到settings.py的INSTALLED_APPS中, 以south, re ...
- IOS调用WCF服务,WCF服务器进行上传图片
1.IOS端采用post方式请求服务器端的url地址 如:http://192.168.0.12:50000/serverce1.svc/upload IOS端的代码采用base64位编码的方式传值给 ...
- ubuntu安装goldendict以及添加本地词典和在线词典
软件在ubuntu软件中心安装就可以了, 关于网络词典, 推荐有道在线词典,网址http://dict.youdao.com/search?q=%GDWORD%&ue=utf8 添加方法:编辑 ...
- STM32 GPIO外部中断总结
一.STM32中断分组: STM32 的每一个GPIO都能配置成一个外部中断触发源,这点也是 STM32 的强大之处.STM32 通过根据引脚的序号不同将众多中断触发源分成不同的组,比如:PA0,PB ...
- linux中shell变量$#,$@,$0,$1,$2的含义解释(转)
变量说明: $$ Shell本身的PID(ProcessID) $! Shell最后运行的后台Process的PID $? 最后运行的命令的结束代码(返回值) $- 使用Set命令设定的Flag一览 ...
- 利用xtraBackup实现不停master服务做主从同步
MySQL主从同步原理: MySQL主从同步是在MySQL主从复制(Master-Slave Replication)基础上实现的,通过设置在Master MySQL上的binlog(使其处于打开状态 ...
- Winpcap安装,Cannot open include file 'pcap.h'
VC报错 fatal error C1083: Cannot open include file: 'pcap.h': No such file or directory Winpcap是window ...
- 使用git svn clone迁移svn仓库
使用git svn clone迁移svn仓库 clone命令可以指定很多参数,主要用到这些,你也可以使用git svn help查看完整的参数列表. git svn clone https://172 ...
- 黑马程序员-nil Nil NULL NSNull 野指针和空指针
空指针1.空指针指不含有任何内存地址的指针.在没有具体初始化之前,其被符值为0Dog * dog = nil;Dog * dog = NULL;都为空指针2.野指针指指向的内存为垃圾内存,导致其值不确 ...
- 简单的比大小 shell 脚本和ping
#!/bin/bash echo "输入第一个数字"read Aecho "输入第二个数字"read B if [ $A -gt $B ] thenecho & ...