문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top