Design by Contract
This talk shows what Betrand Meyer's Design by Contract is and how it can be applied in C#/.NET.
Event Details
As early as 1988, Bertrand Meyer — one of the pioneers of object-oriented programming — introduced the concept of Design by Contract (DbC) in his book Object-Oriented Software Construction. But what exactly is DbC, and are we already applying its principles effectively in our daily programming work?
In this talk, we’ll take a detailed look at the key elements of DbC — assertions, preconditions, postconditions, and class invariants — and explore how they can be used to verify the correctness of our code. We’ll also examine how DbC relates to object-oriented programming and other OOP design principles. In addition, we’ll take a closer look at Microsoft’s Code Contracts, which enable developers to implement DbC in their own codebases, and discuss alternative approaches to this framework.