接口在设计模式中的应用  被引量:4

The application of interface in design patterns

在线阅读下载全文

作  者:陈天超[1] 

机构地区:[1]兰州职业技术学院信息工程系,甘肃兰州730070

出  处:《自动化与仪器仪表》2013年第5期112-115,共4页Automation & Instrumentation

基  金:甘肃省教育科学规划课题研究成果;甘肃省教育科学"十二五"规划课题([2012]GSGXG111)

摘  要:在Java语言中,接口是抽象方法和域的集合。接口与所实现的类之间建立了一种协议,或者说是一种编程规范。Java语言把接口提升为一种独立结构,从而将接口规范和接口实现相分离。适当地使用接口能够简化并完善程序,但在一些特定的应用环境中需要使用面向接口的设计模式,适配器模式就是其中的一种。适配器模式分为类适配器和对象适配器两种,本文通过实例介绍这两种模式在程序设计中的应用,并归纳这两种设计模式之间的区别。Interface is a set of abstract method and field in Jave language; it establishes a protocol, or a programming specifica- tion with concrete class. Java language elevates interface as an independent structure to separate interface protocol with interface re- alization. Using interface appropriately can simplify and improve program, but the pattern of interface oriented design is needed in some specific application environment, and the adapter pattern is one of them. The adapter pattern can be divided into class adapter and object adapter. This easy introduces the application of the above two patterns in the program design and concludes the differenc- es between them.

关 键 词:接口 设计模式 类适配器 对象适配器 

分 类 号:TP311.11[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象