Class_invariant Class_invariant

Class invariant - Definition and Overview

This article is about class invariants in computer science; for use of the term in mathematics, see equivalence class and invariant.


In computer science, a class invariant is an invariant used to constrain objects of a class. Methods of the class should preserve the invariant.

Class invariants are established during construction and constantly maintained between calls to public methods. Temporary breaking of class invariance between private method calls is possible, although not encouraged.

Copyright 2009 WordIQ.com - Privacy Policy  :: Terms of Use  :: Contact Us  :: About Us
This article is licensed under the GNU Free Documentation License. It uses material from the this Wikipedia article.