Contracts are important for Web services. Design by contract (DBC) is nothing new, but, unfortunately, formal precondition and postcondition specifications have never become mainstream, at least not in the way they were presented by Bertrand Mayer in Object Oriented Software Construction.
However, with the advent of Web services, I think it‘s time to re-introduce DBC to the mainstream. Here‘s why:
Preconditions and postconditions for Web services must support the following capabilities:
So what is the solution? I‘m hoping that at some point DBC will find its way into one of the numerous WS specifications. For example, there are some “traces” of DBC in the newly announced WS-Semantics. Although at this point WS-* specifications proliferate at such speed that I doubt that anyone can keep up with them (except, of course, vendors and standard organizations who keep churning them out) so it may do more harm than good.
So the easiest solution for the time being could be for service providers to actually develop client libraries that implement preconditions (and may be even postconditions). This will allow the clients to deal with APIs (and perhaps the source code) expressed in the language that they understand instead of having to deal with bare-bone WSDL which has to be translated into the target language anyway. These libraries can even include “stubbed” versions of the services that can run entirely on the client for testing purposes. Yes, it‘s more work for service providers, but, realistically, how many different languages/platforms are we talking here? In enterprise it probably boils down to various flavors of J2EE and .NET. There are also Python, PHP , Ruby and JavaScript for AJAX clients. For a commercial service provider, the cost of developing these fairly simple client libraries will be returned many times over by the added convenience for the clients. For an example, just look at pygoogle and other Python wrappers for popular Web services. Granted, this approach does not fully address my second requirement for state validation (although it can be done using a smart client library), but I think it‘s a good start nevertheless.
[...] A. (2005) Design by Contract for Web Services [Online]. Available from: http://myarch.com/design-bycontract-for-web-services (Accessed: 19 March [...]
Hi,
Can you help me explain:
Why Design by Contract between web services?
Why verifying the combination of web services through the contract?
thanks!
Recommended Websites…
[...]below you’ll find the link to some sites that we think you should visit[...]…
3d webdesign…
[...]Design by Contract for Web Services[...]…