Home // International Journal On Advances in Software, volume 5, numbers 1 and 2, 2012 // View article


Design by Contract for Web Services: Architecture, Guidelines, and Mappings

Authors:
Bernhard Hollunder
Matthias Herrmann
Andreas Hülzenbecher

Keywords: Design by contract; Web services; WS-Policy; Contract policies; WCF; JAX; Contracts for Java; Contracts-aware proxies

Abstract:
Software components should be equipped with well-defined interfaces. With design by contract, there is a well-known principle for specifying preconditions and postconditions for methods as well as invariants for classes. Although design by contract has been recognized as a powerful vehicle for improving software quality, modern programming languages such as Java and C# did not support it from the beginning. In the meanwhile, several language extensions have been proposed such as Contracts for Java, Java Modeling Language, as well as Code Contracts for .NET. In this paper, we present an approach that brings design by contract to Web services. We not only elaborate a generic solution architecture, but also define its components and investigate the foundations such as important guidelines for applying design by contract. Technically, the contract expressions imposed on a Web service implementation will be extracted and mapped into a contract policy, which will be included into the service's WSDL interface. Our solution also covers the generation of contract-aware proxy objects to enforce the contract policy on client side. We demonstrate how our architecture can be applied to .NET/WCF services and JAX Web services.

Pages: 53 to 64

Copyright: Copyright (c) to authors, 2012. Used with permission.

Publication date: June 30, 2012

Published in: journal

ISSN: 1942-2628