MDA(model driven architecture)的一个重要意图是将模型作为软件开发的基本单元,以进一步提高软件开发的抽象层次.为此,MDA划分了3种抽象级的模型,并通过建立高抽象级的模型和向低抽象级模型及代码的转换来构造可运行的应用程序.在MDA的框架下,将设计模式作为一种独立的建模和转换单元能够在较高的抽象层次上充分支持复用并提高建模粒度,从而进一步发挥设计模式的优点,提高软件开发效率、降低生产成本.然而,要在MDA的框架下将设计模式作为完整的开发单元来使用,必须解决以模式为单元的建模及转换两个具体问题.针对单元化模式建模的问题,通过扩展MOF(meta object facility)的方式定义了模式单元元模型,并提供了基于此元模型的单元化建模支撑机制,以分离业务模型与模式模型的方式解决了该问题.针对单元化模式模型转换问题,在模式单元元模型的基础上定义了向EJB平台的转换规则.该转换规则使用QVT标准描述,支持单元化的模式模型转换,并具有良好的复用性.
A motivation of MDA (model driven architecture) is to use models as programs so as to increase the abstract level of software development. Design patterns provide reusable constructs that can be introduced into MDA to increase the modeling granularity as well as the reusability of model transformation rules. This can be achieved by applying design patterns as the integrated development units in MDA, which raises two problems of modeling and model transforming. First, patterns should be used as integrated modeling units. Second, pattern models should be transformed by applying pattern transformation rules built on the pattern units. To solve these two problems, a solution is to define pattern unit metamodel for each pattern and to provide the EJB model transformation rules basing on each pattern unit metamodel respectively. In this way, patterns canbe used as integrated modeling units by instantiating the pattern metamodel units, and then the pattern models can be transformed into the EJB models by applying the transformation rules. This paper also demonstrates how to extend MOF (meta object facility) meta-metamodels to define the pattern specifications and how to define the transformation rules to map the pattern models as well as related business models onto the EJB platform.