本文给出了一个企业可视化开发环境中实体设计器的解决方案及实现技术。用于解决软件开发过程中数据持久层模型的构建、自动代码生成和自动生成脚本问题。
实体设计器是一个快速建模的工具,同时也是一个代码生成器和数据库脚本的自动生成器。使用该设计器,开发人员可通过建类图的方式,快速为实体建模。建模完成后,通过编译模型即可自动生成相应的标准持久化代码及相应的数据库脚本。从而大大降低开发人员的编码工作量,同时通过标准代码的生成,尽可能的降低了BUG的产出,提高了代码的重用性和开发效率、保证了开发质量。
本文采用敏捷开发思想,利用标准的UML建模语言或者控件(标准或自定义),对实体进行快速建模。自动生成基于Visual Studio 2005的程序框架,对于通用的功能由代码生成器根据一定的规则,自动生成相应标准化的代码。可根据项目要求的不同生成不同高级语言的代码(如C#,C++等)。
该解决方案是一个企业项目针对商业实体持久化的通用的解决方案,具有很强的通用性。对于具有简单业务逻辑的一些商业应用基本不需要再编写什么代码就可实现其基本的功能,如档案类的实体;对于复杂的如ERP产品...
【英文摘要】
This article gives us a solution to the entity designer and the reality technology in the enterprise's visual development environment. It can solve the following problems: the construction of the data persistence model, automatic code generation and auto-generation script in the process of the software development.
The entity designer is a rapid modeling tool and is also a code generator and an automatic generator of the data script. Using this designer, the developers can model for the entity...