用户名: 密码: 验证码:
基于MOF的可执行模型工具的研究与实现
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
在传统的软件开发中存在着生产效率低,可移植性和互操作性差,以及维护困难与文档质量不高等问题,为了解决这一系列问题,OMG提出了一种新的软件开发框架—模型驱动架构(MDA)。MDA开发方法的核心思想是自动化地实现问题域的问题向解空间的解的转换,换而言之,传统开发方法中软件开发人员重点关注代码实现,而MDA开发方法中重点关注的是业务领域的业务模型和业务设计。因此,建模就成为了开发优秀软件的所有活动中的核心部分。
     本文的主要内容是一种基于MOF的可执行模型工具的研究与实现。通过研究MDA相关理论及一些核心技术标准(如MOF、UML等),研究模型的可执行性,为基于MOF的可执行模型工具提出理论依据和实现手段。该工具是可视化的、面向对象的建模工具,根据不同的建模语言(即元模型)建立特定领域中特定的实际应用模型,即模型,并可以实现模型的导入、导出、编辑、转换、验证、可执行以及持久化。该工具的实现采用MVC体系结构,自上而下划分为表示层、业务逻辑层和数据持久层。
With the development of software area, developers have been able to build more complex and huge systems. However, programming is still a labor-intensive activity. When new technique occurs or requirements change, developers have to do repetitive work, which leads to the waste of human resources and time, as well as the low efficiency of software development.
     In order to improve the development efficiency, portability, interoperability and maintainability of software, and enhance the convenience of documents, Model Driven Architecture (MDA), a new software development framework, was proposed by Object Management Group (OMG). The key of MDA is model plays a very important role in the process of software development.
     In MDA, the process of software development is driven by modeling behavior of system, which aims to achieve four objectives as follows: first, to realize the system visualization by modeling according to actual situation and user requirements; second, to specify the structure and behavior of system by model; third, to provide a template to guide developers constructing system; four, to write documents for developer’s decision-making. In early software development, the transformation from model to model and model to code depends on manual implementation. But it is executed by special tool in MDA. Therefore, it has great significance to develop tool for realizing model creating and transformation.
     The subject comes from provincial project-CNSP (Communication Net Software Platform), and executable model tool based on MOF is designed as subsystem. It is a visual and object-oriented tool, which supports CNSP structure and makes the system customized. Meanwhile, this tool can also be used as an independent modeling tool, it is convenient to the cooperative work among different systems through creating domain model according to domain meta-model. So it is an all-purpose tool in a sense.
     As core technology in MDA, UML and MOF provide theoretical foundation for executable model tool.
     MOF is a general and abstract language used for defining meta-model, it is called meta-metamodel sometimes. MOF is object-oriented, and it defines basic elements, syntax and structure of meta-model, as well as a common abstract language for constructing object-oriented meta-model which can be general like UML, or face particular application fields like CWM.
     UML is a standard modeling language. Most of models in the process of software development are UML models. UML is defined by MOF, and MOF is described with UML, thereby they supplement each other. Firstly, meta-model based on a new language is defined by MOF meta-meta model, namely a brand new meta-modeling language. Secondly, meta-models in special domain are created using meta-modeling language, which are also called domain models, and the functions of importing, exporting, combining and transforming on meta-models are given. Finally, application models of special domain are created based on these meta-models. Subsequently, application models are managed via importing, exporting, transforming, validating and executing. The process of building model is visualization, and the models are normal because they are based on diagram syntax of UML.
     In order to make model executable, operations are added to meta-modeling language based on MOF, and OCL expressions are used for defining the constraint of model. Thus meta-model is executable as it is built in aforementioned language. In other words, model that is built following meta-model is executable. Notably, it is possible to validate whether the model of system is correct and satisfies user key requirements via executing model after modeling.
     The main functions of executable model tool based on MOF are as follows:
     1. Project management: it contains the creating, importing, saving and deleting of project, and the importing and updating of meta-model.
     2. Model management: it contains the creating, modifying and deleting of model and model relations. Such as snapshot, object and object attributes, as well as the instances of aggregation relation and reference relation.
     3. Importing and exporting of model: it is necessary to distill information from mode database when importing. The model can be represented with tree structure or diagram. When exporting, it needs to save the information about model to model database.
     4. Validating and executing of model: to make sure the model follow the constraint of meta-model.
     5. Transformation from PIM to PSM: to build up relational database for saving model information according to the organization structure of meta-model.
     Modeling tool adopts MVC (model-view-controller) architecture to implement above-mentioned functions of system, which is divided into three layers: presentation layer, business layer and data persistence layer. Presentation layer is user interface of whole system. It is used for information interchange between user and system. And its main function is the visual construction and management of model. Java, SWT/JFace and GEF (Graphical Editor Framework) of Eclipse development framework are major implementation techniques during the development of modeling tool. Business layer is the core part of modeling tool, which locates in presentation and data persistence layer. It provides various operations and service interface to manage model. Simultaneously, it also provides the accessing operation to database, because the modifying of model may effect the modification of model database information. In this layer, the component of J2EE EJB is the primary technique. At present, the criterion of EJB3.0 is the latest version in a series of EJB criteria. It has some advantages, such as simplifying program and deployment models of EJB techniques, eliminating interfaces of home, object and component etc. Data persistence layer adopts Mysql database to realize the data management of model information. It includes maintaining and saving models especially the generation of relational database of model for the presentation subsystem of CNSP based on imported meta-model.
     In conclusion, this paper aims to research on MOF standard in MDA and the executability of model. Then an executable model tool based on MOF is implemented on this basis. Using this tool, special application models are created in different modeling language and various operations such as importing, exporting, modifying, transforming, validating, executing and persistence are provided.
引文
[1] Anneke Kleppe, Jos Warmer, Wim Bast 著, 鲍志云译, 解析 MDA, 人民邮电出版社, 2003.
    [2] 梁正平, 毋国庆, 肖敬, 喻超, 胡红雷, 基于模型驱动的软件体系结构, 计算机应用研究, 2002:44-46, 134.
    [3] Grady Booch, James Rumbaugh and Ivar Jacobson 著, 邵维忠 张文娟 孟祥文译, UML 用户指南, 机械工业出版社, 2001:25-30.
    [4] Grady Brooch, James Rumbaugh, Invar Jacobson, The Unified Modeling Language User Guide, Addison Wesley Longman, Inc, 1999.
    [5] Craig Lawman, UML 和模式应用, 机械工业出版社, 2002-01.
    [6] OMG, A Status on OMG Architecture-Driven Modernization Task Force, www.omg.org, 2005.
    [7] Friedrich Steimann, Why Most Domain Models are Aspect Free http://www.kbs.uni-hannover.de/steimann/published/UML2004AOM.pdf, 2004-08.
    [8] Akos Ledeczi, Miklos Maroti, Arpad Bakay, etc. The Generic Modeling Environment, WISP'2001, IEEE.
    [9] Shane Sendall and Wojtek Kozaczynski, Model Transformation: the Heart and Soul of Model-Driven Software Development[J], IEEE SOFTWARE, 2003. 9.
    [10] Jorn Bettin, Model-Driven Software Development Executive Overview, MDA Journal, 2004.
    [11] OMG, MDA Guide Version 1.0.1, http://www.omg.org/mda/, 2005.
    [12] David S.Frankel 著, 鲍志云译, 应用 MDA, 人民邮电出版社, 2003.
    [13] Linda Heaton, OMG Meta Object Facility (MOF) 1.4 Specification, http://www.omg. org/mda/specs. htm, 2002.
    [14] C Atkinson, T K uhne, The role of meta-modeling in MDA, UML 2002 Workshop on Software Model Engineering, 2002.
    [15] OMG, MOF 2.0 Core. Version 2.0, November 2003.
    [16] OMG, Common Warehouse Metamode (CWM) Specification. Version 1.0, February 2001.
    [17] Chris Raistrick, Paul Francis, John Wright, Colin Carter, Ian Wilkie 著,赵建华, 张天等译, MDA 与可执行 UML, 机械工业出版社, 2006.3.
    [18] UML Profile, http://www.omg.org/technology/documents/ modeling_spec_catalog.htm
    [19] 兰庆国, 可执行元模型关键技术研究[博士学位论文], 吉林大学, 2006.4.
    [20] S.J. Mellor, M.J. Balcer, Executable UML : A Foundation for Model Driven Architecture [M], Addison-Wesley Professional, May 15, 2002.
    [21] Project Technology, Inc. Executable Translatable UML [EB/OL]. www.projtech.com/pdfs/xtum l/xtum l_full.pdf, 2006
    [22] xtUML, xtUML Specification [S], http://www.omg.org/docs/syseng/02-08-02.doc, 2005
    [23] Eric Clayberg, Dan Rubel 著, 周良忠译, Eclipse 插件开发, 北京: 人民邮电出版社, 2006.10.
    [24] Randy Handson 著, How to apply GEF, http://www.106.ibm.com/developerworks/views/opensource/articles.jsp, 2005.
    [25] Bill Burke, Richard Monson-Haefel 著, 莫映, 徐昊, 胡凯译, Enterprise JavaBeans 3.0: 第 5 版, 电子工业出版社, 2007.5.

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700