工厂设计模式的研究与应用
    点此下载全文
引用本文:葛 萌,欧阳宏基.工厂设计模式的研究与应用[J].计算技术与自动化,2017,(2):136-140
摘要点击次数: 773
全文下载次数: 0
作者单位
葛 萌,欧阳宏基 (咸阳师范学院 计算机学院 陕西 咸阳 712000 ) 
中文摘要:为了提高传统JDBC框架的复用性,分析了工厂设计模式的三种具体形式:简单工厂、工厂方法和抽象工厂。阐述了三者之间的优缺点,从进化和退化两个方面分析了三者之间的转换关系。将工厂设计模式与JDBC相结合,设计了一个数据持久层模型,给出了该模型的设计思想与若干核心代码。通过相关分析与测试表明:将工厂设计模式应用到持久层的设计中能够减少代码的冗余度、提高复用性和扩展性。
中文关键词:简单工厂  工厂方法  抽象工厂  JDBC
 
Research and Implementation of Factory Design Pattern
Abstract:In order to improve the reusability of the traditional JDBC framework,this paper analyzes three concrete forms of the factory design pattern,which are simple factory,factory method and abstract factory. expounds the advantages and disadvantages of the three,the transformation relationship between the three is analyzed from two aspects of evolution and degradation.designs a data persistence layer model with combining factory design pattern and JDBC,gives the design idea and some core codes of the model.Through the correlation analysis and test,it is indicated that the factory design pattern can be applied to the design of persistent layer,which can reduce the redundancy of the code,improve the reusability and expansibility.
keywords:simple factory  factory method  abstract factory  JDBC
查看全文   查看/发表评论   下载pdf阅读器