本文已被:浏览 830次 下载 1819次
Received:September 23, 2020 Revised:October 21, 2020
Received:September 23, 2020 Revised:October 21, 2020
中文摘要: 分析了传统JDBC框架存在的代码复用性低、耦合度高、不易移植、易出现网络故障导致Connection对象失效等缺陷, 结合若干设计模式和数据库重连机制, 提出了一种改进的JDBC框架. 该框架通过DAO模式向业务逻辑层提供调用持久化逻辑的接口、解耦合业务逻辑与持久化逻辑; 利用模板、策略和工厂模式封装DAO的具体实现, 实现具体持久化代码的统一性并减少代码的冗余度. 将改进的JDBC框架应用于某高校绩效考核管理系统, 实践结果表明, 通过使用改进的JDBC框架, 有效增强了系统的鲁棒性, 解耦合了数据持久层与业务逻辑层, 提高了数据持久层代码的复用率和开发效率.
Abstract:The traditional JDBC framework is featured by low code reusability, high coupling, and difficult transplantation, with connection object failures caused by frequent network faults. In this study, we propose a novel JDBC framework combined with several design patterns and the database reconnection mechanism. Through the DAO pattern, the proposed method provides the persistence logic interface, the decouple business logic and the persistence logic to the business logic layer. The concrete implementation of DAO is encapsulated through templates, strategies and factory patterns, improving uniformity of persistence codes while reducing code redundancy. This novel framework is applied to the performance evaluation system in a university. The results demonstrate that the improved JDBC framework decouples the data persistence layer from the business logic layer and improves the reuse rate and development efficiency of the codes in the data persistence layer, enhancing the robustness of the system.
文章编号: 中图分类号: 文献标志码:
基金项目:咸阳师范学院“青年骨干教师”培养项目(XSYGG201615); 咸阳师范学院专项科研计划(XSYK19021, XSYK19054)
引用文本:
葛萌,欧阳宏基,陈伟.改进JDBC框架的研究与应用.计算机系统应用,2021,30(6):107-111
GE Meng,OUYANG Hong-Ji,CHEN Wei.Research and Application of Improved JDBC Framework.COMPUTER SYSTEMS APPLICATIONS,2021,30(6):107-111
葛萌,欧阳宏基,陈伟.改进JDBC框架的研究与应用.计算机系统应用,2021,30(6):107-111
GE Meng,OUYANG Hong-Ji,CHEN Wei.Research and Application of Improved JDBC Framework.COMPUTER SYSTEMS APPLICATIONS,2021,30(6):107-111