0

I know there's a technical term for this and for the life of me I can't remember it:

When designing a class (or some kind of thing with a functions and data), each call to the object's methods should leave the object's data in a consistent state. "Consistent" means in accord with a series of (hopefully documented, usually not programmed in) constraints called [X]s.

josh
  • 9,038
  • 8
  • 31
  • 37

1 Answers1

1

I think you're getting at "invariants".

Preconditions are things that must be true prior to a method execution. Invariants are things that are always publicly true, and post-conditions are things true following method execution.

Erik Dietrich
  • 6,080
  • 6
  • 26
  • 37