首页> 中文期刊> 《计算机技术与发展 》 >基于模板的.Net三层架构的代码自动生成

基于模板的.Net三层架构的代码自动生成

             

摘要

hree layers architecture is the most commonly used layered structure in database development. Three layers structure can improve code reuse rate and reduce the difficulty of project development. In order to solve the problem that manual programming code of three layers architecture is a big workload and easy to make mistake, using dynamic compile and reflecting technique provided by the , Net platform designs and realizes the automatic code generator that based on the customizable template. The code generator uses this feature that the code of three layers structure relies on the structure of the database information. Taking database schema information, Xml configuration files and template files as input, the code generator produces the code of three layers architecture as output. Users can change the content of the Xml configuration files, and can customize , modify their own template files by using template language provided by the code generator, conveniently and flexibly controlling the output of the object code. In practical project development the use of code generator is of great significance.%三层架构是数据库开发中最常用的分层架构.三层结构能够提高代码重用率,降低项目开发难度.为了解决手工编写三层架构的代码工作量大且容易出错的问题,使用.Net平台提供的动态编译和反射技术,设计并实现了基于可定制模板的自动代码生成器.该代码生成器利用三层架构的代码依赖数据库的架构信息这一特点,以数据库架构信息、Xml配置文件和模板文件作为输入,输出三层架构的各层代码.用户可以修改Xml配置文件的内容和使用该代码生成器提供的模板语言定制、修改自己的模板文件,方便、灵活地控制输出的目标代码.代码生成器的使用在实际的项目开发中具有重要的意义.

著录项

相似文献

  • 中文文献
  • 外文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号