Page 10 : 32
Object-oriented Programming in C#
Contracts and Assertions
* Correctness
Software Qualities
Correctness
Specifications
* Specification with preconditions and postconditions
Logical expressions
Examples of preconditions and postconditions
An Assertion Language
* Responsibilities and Contracts
Questions Related to Responsibility
Division of Responsibilities
The highly responsible program
Responsibility division by pre and postconditions
Contracts
Everyday Contracts
Contracts: Obligations and Benefits
Obligations and Benefits in Sqrt
* Class Invariants
General aspects of contracts
Everyday invariants
An example of a class invariant
* Inheritance is Subcontracting
Inheritance and Contracts
Subcontracting
Class invariants in the triangle class hierarchy
Assertions in Abstract classes
* Design by Contract
Design by Contract
DBC and Programming Languages
Code Contracts in C# 4.0
* Loop Invariants
Loop Invariants
Questions Related to Responsibility
Is there an even and balanced
distribution of responsibility
among the objects?
Are there objects around that are burdened by unreasonable
amounts of responsibility
?
And presumably hereby also by too much
complexity
.
Are there responsibilities that no object care about?
Are the responsibilities that two objects redundantly care about?
Due to weak rules about division of responsibilities.