• 中国计算机学会会刊
  • 中国科技核心期刊
  • 中文核心期刊

J4 ›› 2010, Vol. 32 ›› Issue (4): 67-70.doi: 10.3969/j.issn.1007130X.2010.

• 论文 • 上一篇    下一篇

一种支持MDA的UML类图到RDB模型的转换方法

曾一,王健,洪媛,周欣,蔡森虎   

  1. (重庆大学计算机学院,重庆 400030)
  • 收稿日期:2009-06-25 修回日期:2009-10-10 出版日期:2010-03-28 发布日期:2010-03-28
  • 通讯作者: 王健 E-mail:sword_129@163.com
  • 作者简介:曾一(1961-),男,山西大同人,教授,CCF会员(E20011087S) ,研究方向为软件工程;王健,硕士生,研究方向为软件建模技术;洪媛,硕士生,研究方向为软件建模技术。

MDASupporting Transformation from UML Class Diagram to RDB Model Approach

ZENG Yi,WANG Jian,HONG Yuan,ZHOU Xin,CAI Senhu   

  1. (School of Computer,Chongqing University,Chongqing 400030,China)
  • Received:2009-06-25 Revised:2009-10-10 Online:2010-03-28 Published:2010-03-28
  • Contact: WANG Jian E-mail:sword_129@163.com

摘要: UML被MDA用来描述各种模型,成为建模语言事实上的标准。但是,由于UML类图中缺少对关系数据库的实现的约束,使得类图转换到的关系数据库模型不唯一,不能充分体现设计者对数据库的设计意图。这不利于MDA中PIM模型和关系PSM模型的双向转换。为解决以上问题,本文提出一种通过添加构造型和OCL约束来扩展UML类图的方法,以加强类图中数据之间的关系及约束,使PIM模型能够唯一地转换到PSM模型。最后,采用QVT模型转换方法将扩展后的UML类图转换到关系数据库模型,并结合例子给出了UML类图的关联、继承、组合和聚合关系等到关系数据库模型的转换规则和方法。利用本方法可以使UML类图到关系数据库模型的转换结果唯一。

关键词: UML类图, 关系数据库模型, 模型转换, OCL, QVT

Abstract: UML is used to describe a variety of models by MDA .UML is an actual standard for modeling languages. Because of the lack of constraints over the realization of relational database models in UML class diagram design, the outcome of the transformation from the UML class diagrams to the realization of relational database models is not exclusive. It can not sufficiently achieve the designer's intentions on the database and it is inconvenient in doubledirectional transformation from PIM to relational PSMs in MDA. To solve the problem mentioned above, an approach is proposed to enhance the relationship and the constraints of data in class diagrams which can extend UML by adding stereotypes and OCL constraints to build exclusive relational PSMs from PIM. Finally, a method based on QVT is provided for transferring the extended UML class diagrams to relational database models. In several examples the transformation rules are defined for association, inheritance, aggregation and combination of the UML class diagrams etc. It can get the exclusive outcome of the transformation from the UML class diagrams to the relational database models using this method.

Key words: UML class diagram;relational database model;model transformation;OCL;QVT

中图分类号: