APP下载

一种基于同构群的构件接口适配方法

2018-08-15祁华成陆英

软件工程 2018年5期

祁华成 陆英

摘 要:构件化软件一直面临着构件组装过程的失配问题。对此,本文利用形式化方法建立了构件接口模型,提出了端口同构群和等价端口的概念,并证明了交互构件之间通过等价端口实现相互通信。最后,通过实例应用阐述了构件端口适配方法步骤,建立适配器解决等价端口的失配问题,为构件化软件接口之间的不匹配提供了一种可行的解决方法。

关键词:件接口模型;同构群;等价端口;适配器

中图分类号:TP3-0 文献标识码:A

Abstract:Component-based software is always facing the problem of mismatch in assembly process.To solve this problem,component interface model is established using the formal method,the concept of port isomorphic group and equivalent port are proposed.It proves that the equivalent ports can call each other through the reconfiguration port in the paper.Through an example,the steps of component port adaptation are given,and the adapter solves the problem of the mismatch of the equivalent port,which provides a feasible solution for the mismatch between the component-based software syntax.

Keywords:component interface model;isomorphic group;equivalent port;adapter

1 引言(Introduction)

随着Web服务和网构软件[1]概念的提出,通过组装已有构件产生新的软件,焦点在于复用,复用有三方面的要求:构件实体具有通用性、构件功能具有完备性、构件接口具有兼容性[2]。由于这三方面相互对立,因此,组装第三方构件失配现象是不可避免的,本文工作重点是自动化生产构件端口适配器解決构件接口失配问题。

为了增强构件的复用度,国内一些学者从二进制代码重用[3]、特定领域软件复用[4]、模型驱动简化自适应系统[5]出发做了相关研究,目前,已有大量工作研究构件适配方法并延伸到Web服务等领域,从适配方法上分为限制性方法和生成性方法[6],限制性方法是指从构件协议中删除引起失配路径的方法,缺点是构件丧失了部分功能,可能导致不可预测的失陪问题;生成性方法是指不更改构件行为与功能,通过重排序消息及数据生成适配器协调的方法,优点保留构件功能完备性,缺点是需要修改构件接口语法,目前的研究主要使用生成性方法。……

登录APP查看全文