Journal of Hebei University of Water Resources and Electric Engineering ›› 2021, Vol. 31 ›› Issue (2): 72-76.DOI: 10.16046/j.cnki.issn2096-5680.2021.02.013

• Technology Theory and Application • Previous Articles     Next Articles

Design and Implementation of an Efficient Universal Data Access Layer Based on Interface Programming

XU Zhao-xing   

  1. Big Data College,Jiangxi Institute of Fashion Technology,330201,Nanchang,Jiangxi,China
  • Received:2020-07-22 Revised:2020-09-18 Online:2021-06-30 Published:2021-07-30

一种基于接口编程的高效通用数据访问层的设计与实现

徐照兴   

  1. 江西服装学院大数据学院,江西南昌向塘经济开发区丽湖中大道103号 330201
  • 作者简介:徐照兴(1979-),男,硕士,江西服装学院教授,江西服装学院论丛编辑,研究方向为Web数据库应用程序开发、计算机应用技术教学、智能信息系统开发。E-mail:xuzhaoxing@163.com
  • 基金资助:
    江西省教育厅科技项目(GJJ181049)

Abstract: In the development process of large and medium-sized systems,in order to improve the scalability,reusability and maintainability of the system,multi-tier architecture is generally adopted.In the design of multi-tier architecture,the design of data access layer is particularly critical.Through the analysis and research of several open source frameworks,combined with theoretical thinking and practical development experience,the key technologies of optimizing data access layer step by step are analyzed and elaborated from making full use of code and interface reusability,reducing maintenance costs and improving software scalability.A set of universal data access layer technology is formed.At the same time,the code implemented by Entity Framework technology on.Net platform is given.Thus,it can deepen the understanding of common technical ideas of data access layer for software technology developers,and provide a technical reference for peers to implement data access layer.Practice shows that the system using this data access layer technology in multi-tier architecture system has the characteristics of high decoupling,high expansion,high availability and high development efficiency,and has a wide application prospect.

Key words: data access layer, Entity Framework, extensibility, interface, high efficiency, delayed loading

摘要: 在中大型系统的开发过程中,为了提高系统的可扩展性、可复用性及可维护性等,一般会采用多层架构,而在多层架构的设计中数据访问层设计尤为关键。经过对多套开源框架分析研究,结合理论思考和实战开发经验,从充分利用代码和接口可复用性、降低维护成本、提高软件可扩展性出发,分析阐述数据访问层是如何一步步进行优化的关键技术,形成一套通用的数据访问层技术,同时给出.Net平台下用Entity Framework技术实现的代码,从而可以加深加速软件技术开发人员更好地理解数据访问层常用的技术思想,为同行提供一种数据访问层的实现技术参考。经实践运行表明:在多层架构系统中使用该数据访问层技术的系统具有高解耦、高扩展、高可用及开发效率高等特点,具有广泛的应用前景。

关键词: 数据访问层, Entity Framework, 可扩展性, 接口, 高效, 延迟加载

CLC Number: