z Synthesis of decentralized and concurrent adaptors for correctly assembling distributed component-based systems q Marco Autili a , Leonardo Mostarda c , Alfredo Navarra b , Massimo Tivoli a, * a Dipartimento di Informatica, Università dell’Aquila, Via Coppito, I-67100 L’Aquila, Italy b Dipartimento di Matematica e Informatica, Università degli Studi di Perugia, Via Vanvitelli 1, I-06123 Perugia, Italy c Department of Computing, Imperial College London, South Kensington Campus, London SW7 2AZ, United Kingdom article info Article history: Received 14 February 2007 Received in revised form 1 April 2008 Accepted 4 April 2008 Available online 12 April 2008 Keywords: Software architecture Component-based software engineering Component assembly Component adaptation abstract Building a distributed system from third-party components introduces a set of problems, mainly related to compatibility and communication. Our existing approach to solve such problems is to build a central- ized adaptor which restricts the system’s behavior to exhibit only deadlock-free and desired interactions. However, in a distributed environment such an approach is not always suitable. In this paper, we show how to automatically generate a distributed adaptor for a set of black-box components. First, by taking into account a specification of the interaction behavior of each component, we synthesize a behavioral model for a centralized glue adaptor. Second, from the synthesized adaptor model and a specification of the desired behavior that must be enforced, we generate one local adaptor for each component. The local adaptors cooperatively behave as the centralized one restricted with respect to the specified desired interactions. Ó 2008 Elsevier Inc. All rights reserved. 1. Introduction Reuse-based software engineering is becoming one of the main development approaches for business and commercial systems. Nowadays, a growing number of software systems are built as a composition of reusable or COTS (Commercial-Off-The-Shelf) com- ponents and CBSE is a reuse-based approach which addresses the development of such systems. In an ideal world, component-based systems are assembled by simply connecting together compatible ready-to-use components, 1 that jointly provide the desired functionalities. However, in the prac- tice of software development it turns out that the constituent com- ponents often do not perfectly fit together and adaptation is needed to eliminate the resulting mismatches (Becker et al., 2006; Yakimo- vich et al., 1999; Szyperski, 2004; Horwich, 1990; Yellin and Strom, 1997, 2002; Zaremski and Wing, 1995; Schmidt and Reussner, 2002; Becker et al., 2004). In particular, considering third-party and black- box components makes the problem worse since there is no way to inspect the source code for possibly solving mismatches from inside. In this setting, while assembling a distributed system from a set of black-box components interacting by message passing, the specific problem we want to face concerns how to automatically prevent deadlocking and undesired (externally observable) interactions of the resulting system. A widely used technique to deal with this prob- lem is to use adaptors and interpose them among the components that are being assembled to form the system. The intent of the adaptors is to moderate the external communication of the compo- nents in a way that the resulting system is deadlock-free and com- plies with a desired behavior (i.e., desired sequences of messages exchanged among the components). Our previous approach (Inverardi and Tivoli, 2003) (imple- mented in the previous version of our SYNTHESIS tool (Tivoli and Autili, 2006)) is to build a centralized adaptor which restricts the system’s behavior to exhibit only a set of deadlock-free or desired interactions. By exploiting an abstract and partial specification of the global behavior that must be enforced, SYNTHESIS automatically builds such an adaptor. It mediates the interaction among the com- ponents by allowing only the desired behavior specified by the assembler (i.e., the SYNTHESIS user) and, simultaneously, avoiding possible deadlocks. In a distributed environment it is not always possible or conve- nient to introduce a centralized adaptor. For example, existing dis- tributed systems might not allow the introduction of an additional component (i.e., the adaptor) which coordinates the information flow in a centralized way. Moreover, the coordination of several components might cause loss of information and bottlenecks, 0164-1212/$ - see front matter Ó 2008 Elsevier Inc. All rights reserved. doi:10.1016/j.jss.2008.04.006 q This paper is a revised and extended version of Autili et al. (2006) that has been presented at EWSA2006. * Corresponding author. E-mail addresses: marco.autili@di.univaq.it (M. Autili), lmostard@doc.ic.ac.uk (L. Mostarda), navarra@dipmat.unipg.it (A. Navarra), tivoli@di.univaq.it (M. Tivoli). 1 Hereafter the terms component and component instance are used interchangeably. The Journal of Systems and Software 81 (2008) 2210–2236 Contents lists available at ScienceDirect The Journal of Systems and Software journal homepage: www.elsevier.com/locate/jss