计算机工程与应用 ›› 2009, Vol. 45 ›› Issue (28): 6-9.DOI: 10.3778/j.issn.1002-8331.2009.28.002

• 博士论坛 • 上一篇    下一篇

支持MDD的代码生成、映射与逆向技术研究

温 玮,方 伟,何 友,黄晓冬   

  1. 海军航空工程学院 信息融合研究所,山东 烟台 264001
  • 收稿日期:2009-06-25 修回日期:2009-07-31 出版日期:2009-10-01 发布日期:2009-10-01
  • 通讯作者: 温 玮

Research on techniques of code generating,mapping and reversing serving for Model-Driven Development

WEN Wei,FANG Wei,HE You,HUANG Xiao-dong   

  1. Research Institute of Information Fusion,Naval Aeronautical and Astronautical University,Yantai,Shandong 264001,China
  • Received:2009-06-25 Revised:2009-07-31 Online:2009-10-01 Published:2009-10-01
  • Contact: WEN Wei

摘要: 对代码生成、映射以及逆向技术进行了深入研究,并将研究成果应用于支持模型驱动开发的领域建模工具的研制。代码生成采用基于元数据的文本模版演化方案实现,演化机制包含宏替代、条件输出、循环输出;代码映射通过界定框架代码片段,并分别对其进行局部的代码生成、 替换实现;代码逆向通过解析框架代码片段、提取模型信息实现。分析了模版设计、代码扫描所需遵循的文法。给出了软件实现方案。应用结果表明,技术与实现方案在不同的应用环境中体现出良好的适应性和可扩展性。

关键词: 模型驱动开发, 代码生成, 代码映射, 代码逆向

Abstract: The research of the techniques serving for code generating,mapping and reversing is explained,and the corresponding applications into the development of the Domain-Oriented Modeling Tools which support the Model-Driven Development(MDD) are introduced.Code generating is a process of taking evolvements from the code template based on meta-data,key mechanisms for this evolvement include macro-substitution,conditionally code-exporting and circularly code-exporting.Code mapping needs to locate the code segments which mapping the corresponding model information separately,and replace them with the production of the code-generator respectively.Code reversing is realized by parsing the code segments mentioned before and extracting the model information from the segments.Grammars used to design the code templates and conformed by code-parsing are analyzed.The software implementation is also put forward.The applications in diversified environments testify the solution has good adaptability and expansibility.

Key words: Model-Driven Development(MDD), code generating, code mapping, code reversing

中图分类号: