###
DOI:
Journal of Software:2006.17(4):658-669

基于角色的设计模式建模和实现方法
何成万,何克清
(武汉化工学院,计算机科学与工程学院,湖北,武汉,430073)
A Role-Based Approach to Design Pattern Modeling and Implementation
HE Cheng-Wan,HE Ke-Qing
()
Abstract
Chart / table
Reference
Similar Articles
Article :Browse 3427   Download 3228
Received:September 02, 2005    Revised:November 09, 2005
> 中文摘要: 虽然设计模式有利于软件的重用,但当设计模式实例化时,存在模式的重叠、可追踪性以及模式代码难于重用等问题.提出一种基于角色的设计模式的建模和实现方法,在设计和实现两个层面上解决上述问题.该方法把设计模式的角色作为独立的建模元素,在应用程序类和角色间导入RoleOf关系,使应用逻辑和模式逻辑完全分离,从而提高其重用性.使用UML的标准扩充机制,给出了RoleOf关系的元模型和语义,以及标识模式信息的构造型和标记值,以此解决模式的重叠和可追溯性等问题.通过对Java语言进行扩充(称为Rava),实现了应用逻辑和模式逻辑的动态绑定.该方法较好地解决了设计模式实例化时的模式重叠和可追踪性问题,提高了模式逻辑的可重用性,对运用设计模式开发软件有一定的指导作用.
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.
文章编号:     中图分类号:    文献标志码:
基金项目:Supported by the National Natural Science Foundation of China under Grant No.60373086 (国家自然科学基金); the Wuhan Scientific & Technical Key Industrial Project of China under Grant No.20051001007 (武汉市科技局重大产业化项目) Supported by the National Natural Science Foundation of China under Grant No.60373086 (国家自然科学基金); the Wuhan Scientific & Technical Key Industrial Project of China under Grant No.20051001007 (武汉市科技局重大产业化项目)
Foundation items:
Reference text:

何成万,何克清.基于角色的设计模式建模和实现方法.软件学报,2006,17(4):658-669

HE Cheng-Wan,HE Ke-Qing.A Role-Based Approach to Design Pattern Modeling and Implementation.Journal of Software,2006,17(4):658-669