>验证输入参数以确保它们满足预期的输入要求
>保证尊重和尊重保持不变量
>验证输出参数(返回和输出参数)
这本书也有一些很好的名字,但对于我的生活,我不记得了.很困扰我,我不得不来到Stackoverflow,看看是否有人认识到这一点并帮助我记住……
解决方法 概念的名称是 Design by Contract:Expect a certain condition to be guaranteed on entry by any clIEnt module that calls it: the routine’s precondition—an obligation for the clIEnt,and a benefit for the supplier (the routine itself),as it frees it from having to handle cases outsIDe of the precondition. Guarantee a certain property on exit: the routine’s postcondition—an obligation for the supplier,and obvIoUsly a benefit (the main benefit of calling the routine) for the clIEnt. Maintain a certain property,assumed on entry and guaranteed on exit: the class invariant.总结
以上是内存溢出为你收集整理的c – 3 – 承诺函数规则全部内容,希望文章能够帮你解决c – 3 – 承诺函数规则所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)