joint work with Mario Bravetti
Department of Computer Science University of Bologna
Contract-Based Discovery and Composition of Web Services
Gianluigi Zavattaro
zavattar@cs.unibo.it http://cs.unibo.it/~zavattar
Contract-Based Discovery and Composition of Web Services Gianluigi - - PowerPoint PPT Presentation
Contract-Based Discovery and Composition of Web Services Gianluigi Zavattaro zavattar@cs.unibo.it Department of Computer Science http://cs.unibo.it/~zavattar University of Bologna joint work with Mario Bravetti Contracts [FHRR04][CCLP06]
joint work with Mario Bravetti
Department of Computer Science University of Bologna
zavattar@cs.unibo.it http://cs.unibo.it/~zavattar
not only the signature
but also the expected
public registry
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
public registry
public registry
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
public registry
public registry
refines refines
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Reciprocal invocations
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
public registry
public registry
Reciprocal invocations
refines refines
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
is conformant for participant 1 to is conformant for participant n to
public registry
public registry
Reciprocal invocations
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
Preliminaries
Choreography, contract, refinement, conformance
Compliance-preserving refinement
General case (negative result) Output persistence, located outputs
Choreography conformance (negative result)
Consonance
Alternative notions of compliance
Strong compliance, queue-based compliance
Conclusion
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
Preliminaries
Choreography, contract, refinement, conformance
Compliance-preserving refinement
General case (negative result) Output persistence, located outputs
Choreography conformance (negative result)
Consonance
Alternative notions of compliance
Strong compliance, queue-based compliance
Conclusion
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
public registry
public registry
refines refines
compliance preserved by refinement compliant (i.e. correct composition)
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Services publish their interface expressed in
Operational semantics:
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
C’ ≤ C means C’ is a subcontract of C
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Cn
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
Formally, we parametrize subcontract preorders
outputs O: operations that can be invoked by the
inputs I: operations that can be received by the other
Such a knowledge is usable in independent
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
Preliminaries
Choreography, contract, refinement, conformance
Compliance-preserving refinement
General case (negative result) Output persistence, located outputs
Choreography conformance (negative result)
Consonance
Alternative notions of compliance
Strong compliance, queue-based compliance
Conclusion
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
is a subcontract preoder includes all subcontract preorders
max
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Due to output persistence subcontracts cannot
otherwise subcontract compliance w.r.t initial con-
For example: a + c.b ≤N-{c},N-{c} a but not
Executable additional actions on new types can
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
because subcontracts cannot add reachable
max max max max
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
exploiting knowledge we have a+b ≤{a} a in addition to τ.a ≤ τ.a + τ.b (more deterministic)
max max
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
C’ ≤O C is implied by
i.e. ≤O coarser than testing preorder
max
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Preliminaries
Choreography, contract, refinement, conformance
Compliance-preserving refinement
General case (negative result) Output persistence, located outputs
Choreography conformance (negative result)
Consonance
Alternative notions of compliance
Strong compliance, queue-based compliance
Conclusion
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
“ a ” can be received by any C doing “a”
i.e. from choreography, location = participant
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
because compliant contexts of C cannot perform
max max
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
max max max max
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Preliminaries
Choreography, contract, refinement, conformance
Compliance-preserving refinement
General case (negative result) Output persistence, located outputs
Choreography conformance (negative result)
Consonance
Alternative notions of compliance
Strong compliance, queue-based compliance
Conclusion
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
is conformant for participant 1 to is conformant for participant n to
public registry
public registry
Reciprocal invocations
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
P is a composition of compliant contracts Each (completed weak) trace of P has a
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
[τ.as.bs + τ.bs.as ]r | [ τ.a.b + τ.b.a ]s
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Preliminaries
Choreography, contract, refinement, conformance
Compliance-preserving refinement
General case (negative result) Output persistence, located outputs
Choreography conformance (negative result)
Consonance
Alternative notions of compliance
Strong compliance, queue-based compliance
Conclusion
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
H is well-formed if the system P, achieved via
Canonical projection [[ ]]t :
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
proof exploits pre-congruence of testing
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Preliminaries
Choreography, contract, refinement, conformance
Compliance-preserving refinement
General case (negative result) Output persistence, located outputs
Choreography conformance (negative result)
Consonance
Alternative notions of compliance
Strong compliance, queue-based compliance
Conclusion
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
S1: invoke(a).invoke(b) S2: receive(a).invoke(c) S3: receive(c).receive(b)
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
S1: invoke(a).invoke(b) S2: receive(a).invoke(c) S3: receive(c).receive(b)
Strong
These services
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
S1: invoke(a).receive(b).invoke(b) S2: receive(a).invoke(c) S3: receive(c).invoke(b).receive(b)
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Preliminaries
Choreography, contract, refinement, conformance
Compliance-preserving refinement
General case (negative result) Output persistence, located outputs
Choreography conformance (negative result)
Consonance
Alternative notions of compliance
Strong compliance, queue-based compliance
Conclusion
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
“ al ” inserts in queue “a” at location “l” “a” retrieves from local “a” queue
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
Preliminaries
Choreography, contract, refinement, conformance
Compliance-preserving refinement
General case (negative result) Output persistence, located outputs
Choreography conformance (negative result)
Consonance
Alternative notions of compliance
Strong compliance, queue-based compliance
Conclusion
Contract-Based Discovery and Composition of Web Services SFM09:WS - Bertinoro - 5.6.2009
Direct conformance w.r.t. the whole choreography:
Conformance via refinement with knowledge about
(enough to guarantee that refinements that extend the interface are included)
“normal” compliance:
Unconstrained contracts: maximal relation does not exist Contracts where outputs are internally chosen (output persistence):
maximal relation exists and “I” knowledge is irrelevant
Output persistent contracts where outputs are directed to a location:
maximal relation exists and “I/O” knowledge is irrelevant
strong compliance:
Unconstrained contracts (where output are directed to a location):
maximal relation exists and “I/O” knowledge is irrelevant
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
queue-based compliance:
Unconstrained contracts (where output are directed to a location):
maximal relation exists and “I/O” knowledge is irrelevant
Sound characterizations of the relations obtained
As a consequence:
Algorithm that guarantees compliance Classification of the relations w.r.t. existing pre-orders:
coarser than must testing (e.g., they allow external non- determinism on inputs to be added in refinements)
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
τ.a+τ.b ≤ c+c.d is not captured by the
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services
[FHRR04] C. Fournet, C.A.R. Hoare, S.K. Rajamani, and J. Rehof. Stuck-
Free Conformance. In CAV’04.
[CCLP06] S. Carpineti, G. Castagna, C. Laneve, and L. Padovani. A Formal
Account of Contracts for Web Services. In WS-FM’06.
[CHY07] M. Carbone, K. Honda, and N. Yoshida. Structured
Communication-Centred Programming for Web Services. In ESOP’07.
[RV05] A. Rensink and W. Vogler. Fair testing. CTIT Technical Report TR-
CTIT-05-64, Dep. Computer Science, Univ. of Twente, 2005.
[BZ07a] M. Bravetti and G. Zavattaro. Contract based Multi-party Service
[BZ07b] M. Bravetti and G. Zavattaro. Towards a Unifying Theory for
Choreography Conformance and Contract Compliance. In SC’07.
[BZ07c] M. Bravetti and G. Zavattaro. A Theory for Strong Service
Science”.
[BZ08] M. Bravetti and G. Zavattaro. Contract Compliance and Choreogra-
phy Conformance in the Presence of Message Queues. In WS-FM’08.
SFM09:WS - Bertinoro - 5.6.2009 Contract-Based Discovery and Composition of Web Services