[关键词]
[摘要]
很多角色模型的设计和使用存在着一些限制,例如:角色对象的创建及其与源对象的绑定需要通过编码显式完成;角色对象与源对象之间的单向链接使得消息不能在它们之间互相转发等.这些限制使得角色模型的使用较为繁琐,在程序设计中往往会将系统的业务逻辑和对角色对象的控制逻辑混杂在一起.被称为DR 的动态角色模型除了相关工作的基本功能外还提供了角色对象的自动创建及其与源对象之间的双向链接,使得角色对象的使用变得透明.所有这些功能的实现都基于一种简洁、统一的前置对象机制,它不但能较好地处理复杂角色体系,还能与现有的面向对象系统
[Key word]
[Abstract]
There are limitations with most of the current role models. For example, the issues of role creation and attachment have to be handled explicitly in the source code: the navigation between role objects and source objects is unidirectional, and messages cannot be transferred bi-directionally, etc. Such limitations always result in the core business becoming tangled with the control logic for role objects. A dynamic role model, named DR, can provide the automatic creating and destroying mechanisms of role objects and can also provide the bi-directional navigation between role objects and source objects. These functionalities make up the core of the use of the role model, and the control logic for role objects is also transparent to users. The implementation of DR is centered around prepositve objects and delegation mechanisms not only resolves the complex hierarchy of roles problem, but the dynamic role model also solves the compatibility problem with traditional object-oriented systems.
[中图分类号]
[基金项目]
国家自然科学基金(90718027); 国家重点基础研究发展计划(973)(2007CB310806); 湖北省自然科学基金(2008CDA007)