在软件开发过程中,采用代码生成技术可以显著减少开发者的重复性工作量。此外,还可以提升代码的质量并提高可维护性。本文讨论的代码生成引擎基于Velocity开源模板和Struts2注解,实现了模型驱动的开发模式。实践表明,其可以很好地满足基于业务对象模型生成全栈式Web应用代码的需求。
During the development of software, using the technique of code generation can considerably reduce the workload of repetitive code. In addition, it can also improve the quality and maintainability of code. In this paper, will introduce a code generation engine, which is based on the annotation of Struts2 and an open-source project, namely Velocity, implemented the development pattern of model driven. It is concluded that this engine is competent to generate full stack codes for Web applications on the basis of model for business logic.