Design patterns play many roles in the development process. They provide a common vocabulary for design, they reduce system complexity by naming and defining abstractions, they constitute a base of experience for building reusable software, and they act as building blocks from which more complex designs can be built. Design patterns can be considered reusable microarchitectures that contribute to an overall system architecture. Ideally, they capture the intent behind a design by identifying the component objects, their collaborations, and the distribution of responsibilities. The purpose of this book is to show how this intention can be made explicit, based on the notion of contract.
Contracts strengthen and deepen interface specifications.
In return, the supplier promises that the work specified in the postcondition will be done, and the class invariant is still respected. In this way rights and obligations of both client and supplier are clearly delineated, along with their responsibilities. The first Chapter is a short introduction to the notion of Design Patterns, and to their role in the software lifecycle. The second Chapter sets the arguments for an optimal use of Design Patterns in a quality oriented software engineering process, based on Design by Contract and associated technologies. The second part of this book contains three Chapters presenting how the GoF creational, structural and behavioral patterns can be augmented with contracts.