Lecture overview -- Keyboard shortcut: 'u'  Previous page: General aspects of contracts -- Keyboard shortcut: 'p'  Next page: An example of a class invariant -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 20 : 32
Object-oriented Programming in C#
Contracts and Assertions
Everyday invariants

Adherence to invariants is the key to order in our daily lives

  • Coffee Machine

    • In between operations there is always at least one cup of coffee available

  • Toilet

    • In between "transactions" there is always at least 0.75 meter of toilet paper on the roll

  • Keys and wallet

    • In between using keys and/or wallet

      • During daytime: Keys and wallet are in the pocket

      • During nighttime: Keys are wallet are located on the bedside table or underneath the pillow