对状态的预测使用状态不变量;
对象不变量则将特定条件运用于对象的状态上,确保其不会拥有非法的值。
Object invariants are used to enforce certain conditions on objects to make sure they don't obtain illegal values.
对象不变量则将特定条件运用于对象的状态上,确保其不会拥有非法的值。
Object invariants are used to enforce certain conditions on objects to make sure they don't obtain illegal values.
应用推荐