对状态的预测使用状态不变量;
对象不变量则将特定条件运用于对象的状态上,确保其不会拥有非法的值。
Object invariants are used to enforce certain conditions on objects to make sure they don't obtain illegal values.
You can only use the state variables independent of history.
你只能使用不依赖于历史的,状态变量。
应用推荐