c – 3 – 承诺函数规则

c – 3 – 承诺函数规则,第1张

概述我需要帮助记住我从中读到的这本书,它可能是有效的C或其他东西,但我不记得了.我正在阅读的内容基本上表明功能有3个承诺: >验证输入参数以确保它们满足预期的输入要求 >保证尊重和尊重保持不变量 >验证输出参数(返回和输出参数) 这本书也有一些很好的名字,但对于我的生活,我不记得了.很困扰我,我不得不来到Stackoverflow,看看是否有人认识到这一点并帮助我记住…… 概念的名称是 Design 我需要帮助记住我从中读到的这本书,它可能是有效的C或其他东西,但我不记得了.我正在阅读的内容基本上表明功能有3个承诺:

>验证输入参数以确保它们满足预期的输入要求
>保证尊重和尊重保持不变量
>验证输出参数(返回和输出参数)

这本书也有一些很好的名字,但对于我的生活,我不记得了.很困扰我,我不得不来到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 – 承诺函数规则所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/langs/1213719.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-04
下一篇 2022-06-04

发表评论

登录后才能评论

评论列表(0条)

保存