摘要
使用ORM框架访问数据库效率较低,对执行效率有要求的项目一般采用纯手工编写数据库访问代码,但纯手工编写重复的数据库访问代码需要耗费大量时间.文章提出一种数据库访问代码自动生成方法,指出了自动生成代码需要解决的三个关键问题,并以SQLServer数据库为例,描述了生成C#代码的过程.使用数据库访问代码自动生成方法,生成的代码规范、易于维护,节省了程序员编码时间,提高了开发效率.
Accessing the database using ORM framework is inefficient. Projects that require performance efficiency generally use hand-written database access code, but it takes a lot of time to manually write duplicate database access code. This paper proposes a database access code generation method, pointing out three key problems that need to be solved in this code generation method, and takes SQL Server database as an example to describe the process of generating C# code. Code generated by this database access code generation method is regular, easy to maintain, and it saves programmers coding time and improves development efficiency.
作者
熊伟
欧阳逸
张凌云
XIONG Wei;OUYANG Yi;ZHANG Ling-yun(School of Computer Science and Cyber Engineering, Guangzhou University, Guangzhou 510006, China)
出处
《广州大学学报(自然科学版)》
CAS
2019年第3期93-95,共3页
Journal of Guangzhou University:Natural Science Edition
基金
大学生创新创业训练计划资助项目(201711078090)