基于构件的软件工程中,构件行为适应是一个关键的问题.目的是为了解决构件交互过程中由于行为不兼容而引起的各种不匹配问题.给出了解决构件行为不匹配的一种通用的方法.该方法首先根据给定的构件接口的行为协议描述计算构件行为之间的同步关系,得到适配器的描述.然后在构件的同步产品中,利用死锁来检测具有同步行为关系的行为之间的不匹配.利用构件及适配器描述计算同步矢量产品的过程中,根据同步矢量来计算适配器的行为协议,适配器通过一对互补事件与被适应构件进行交互.适配器适应交互的构件行为,使得构件交互过程中没有死锁发生,实现对消息顺序的重新排序,解决了具有数据传递的构件行为之间的不匹配问题.最后,用一个实例对文中所述方法进行了说明.
The behavior adaptation of Software component is a crucial problem in component-based software engineering. Software Adaptation aims at generating, as automatically as possible, adaptors to compensate mismatch between component interfaces, and ensure the deadlock-freedom of the interaction of components at the architectural level. A general approach is proposed to solve the behavior mismatch. The main idea of the approach is firstly to calculate the synchronous vector between component behaviors according to the abstract specification of component behavior, and have the specification of the adaptor. Then, to automate deadlock mismatch detection, it is needed to calculate the synchronous product of STSs, which is the abstract specification of component behavior. The behavior of adaptor can be calculated automatically according to the synchronous vector in the synchronous vector product of the adapted components and the adaptor specification. The adaptor can make the correctness of the component interaction with data exchange, and realize the reordering of message. Finally, an example is presented to illustrate the approach proposed.