Tuesday, November 27, 2007

consistency, integrity and exceptions

I was blaming myself today talking about consistency and integrity without remembering the exact definitions of it. I just remembered that there are some interesting differences between them. What I meant was a definition like Consistency and Integrity.

My point was that exception handling and especially the concept of design by contract could be seen in a similar context. I tried to argue that violating a design by contract-rule(pre/post/invariance) is like violating the 'programs internal consistency'.

But as Consistency and Integrity is just clearly defined in the context of data it seems that my derivation doesn't make sense.

In personally would say a 'program consistency' is maintained as long it's internal state doesn't contain any contradictions. Furthermore a 'program integrity' is maintained as long as the programs internal state does reproduce all related external state correctly.

Following that definition one could say that 'program consistency' can be checked by the design by contract-technique but 'program integrity' cannot. 'program integrity' cannot be checked at all by a program.

No comments: