透明性:前置和后置条件代码不与业务逻辑混合。
Transparency: The pre - and post-condition code isn't mixed with business logic.
在本例中,只要是我指定了OVal约束条件的地方,在OVal代码中定义的逻辑就会编入我的代码,进而充当起前置条件和后置条件。
In this case, everywhere I specify an OVal constraint, the logic defined in OVal code will be weaved into my code, thus acting like preconditions and postconditions.
或者你可以写一份代码来明确检查一下前置条件是否满足。
Or you can write code that checks the preconditions explicitly.
应用推荐