Defining a behavioral contract
When Web Service Components interact with each other, it is important to establish a reliable contract between them. Often the Contract is only defined on a syntactical level, i.e. the signature of the web services that each component offers. The paper (1) discusses, that additionally a behavioral contract is needed. It proposes even more contract levels: the synchronization level and the Quality-of-service level. But let us first discuss the behavioral contract. Some citations from the paper.
When using a third-party component, contracts offer a specification against which you can validate that component. (1)
This is in line with my earlier proposal that this could be covered by what I call a Composite Integrated Development Environment.
Now for web service signatures, this is state of the art.
Unfortunately, because the BankAccount specification does not define precisely the effect of operation executions, the user can only guess at their outcomes. (1)
That is the problem. How is the behavioral contract specified?
The client should only call a contractor routine in a state where the class invariant and the precondition of the routine are respected. In return, the contractor promises that when the routine returns, the work specified in the postcondition will be done, and the class invariant will be respected. (1)
This means, that a behavioral contract should be specified in terms of preconditions of a web service and postconditions of it. In this case a composite IDE can validate models of services consumption against models of service provisioning.
In BPMN 2.0 the abstract process is a possible way to achieve this goal. It defines which behavioral contract the participant offers and under which preconditions (process state) a service can be called. In the same way in (2) the desynchronized choreographies can be seen as such. However in (2) the modeling process is top-down. In practice it could also be bottom-up. Especially if there are existing components with an implemented behavior which is modeled after the fact to allow for contract awareness.
Bibliography
1. Beugnard, Antoine, et al. Making Components Contract Aware. Computer. 1999, Vol. 32, 7, pp. 38 – 45. http://portal.acm.org/citation.cfm?id=621275.
2. Lecture Notes in Computer Science: Non-desynchronizable Service Choreographies. Decker, Gero and Alistair Barros, Frank Michael Kraft and Niels Lohmann. Berlin / Heidelberg : Springer, 2008. Service-Oriented Computing – ICSOC 2008. Vol. 5364/2008, pp. 331-346. http://www.springerlink.com/content/9055736715131767/. ISSN 0302-9743 (Print) 1611-3349 (Online).
