首页 | 本学科首页   官方微博 | 高级检索  
     

基于角色的设计模式建模和实现方法
引用本文:何成万,何克清. 基于角色的设计模式建模和实现方法[J]. 软件学报, 2006, 17(4): 658-669
作者姓名:何成万  何克清
作者单位:武汉化工学院,计算机科学与工程学院,湖北,武汉,430073;武汉大学,软件工程国家重点实验室,湖北,武汉,430072
基金项目:中国科学院资助项目;湖北省武汉市科技局科研项目
摘    要:虽然设计模式有利于软件的重用,但当设计模式实例化时,存在模式的重叠、可追踪性以及模式代码难于重用等问题.提出一种基于角色的设计模式的建模和实现方法,在设计和实现两个层面上解决上述问题.该方法把设计模式的角色作为独立的建模元素,在应用程序类和角色间导入RoleOf关系,使应用逻辑和模式逻辑完全分离,从而提高其重用性.使用UML的标准扩充机制,给出了RoleOf关系的元模型和语义,以及标识模式信息的构造型和标记值,以此解决模式的重叠和可追溯性等问题.通过对Java语言进行扩充(称为Rava),实现了应用逻辑和模式逻辑的动态绑定.该方法较好地解决了设计模式实例化时的模式重叠和可追踪性问题,提高了模式逻辑的可重用性,对运用设计模式开发软件有一定的指导作用.

关 键 词:设计模式的实例化  角色  RoleOf关系  UML  元模型
收稿时间:2005-09-02
修稿时间:2005-11-09

A Role-Based Approach to Design Pattern Modeling and Implementation
HE Cheng-Wan and HE Ke-Qing. A Role-Based Approach to Design Pattern Modeling and Implementation[J]. Journal of Software, 2006, 17(4): 658-669
Authors:HE Cheng-Wan and HE Ke-Qing
Affiliation:1.School of Computer Science and Engineering, Wuhan Institute of Chemical Technology, Wuhan 430073, China; 2.State Key Laboratory of Software Engineering, Wuhan University, Wuhan 430072, China
Abstract:Although design pattern is quite useful in software reuse, there are still many barriers when instantiating the design patterns, such as pattern overlapping, traceability, and difficulties in reusing the pattern code. A role-based approach for design pattern modeling and implementation is proposed. In this approach, roles of pattern are treated as the independent modeling elements and the RoleOf relationship is used to associate a role with an application class. This can improve the reusability of pattern. The meta-model of the RoleOf relationship for pattern instantiation and its semantics are proposed using UML extension mechanism. The stereotypes and tagged values used for identifying pattern information are provided, and it resolves the traceability and overlapping problem in pattern instantiation. The dynamic binding of application and role logic are implemented through the extension to Java language, called Rava. The approach proposed in this paper can effectively solve the problem such as pattern overlapping and traceability during the pattern instantiation, which improves the reusability of pattern logic and guides the software development using design patterns.
Keywords:UML
本文献已被 CNKI 维普 万方数据 等数据库收录!
点击此处可从《软件学报》浏览原始摘要信息
点击此处可从《软件学报》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号