Interfaces as Contracts
Not only requirements on the component, but also on the user, hence the term “contract” of “agreement”
Best captured today by preconditions and postconditions (and perhaps invariants)
- e.g. Eiffel (Meyer)
- Hoare triple: {precondition} operation {postcondition}
Non-functional requirements
- It shouldn’t fail, it should recover, it shouldn’t take too long,…
Example of layout checking as a component approach