.NET 4.0 的契约设计与 Eiffel 相比如何?
我很“高兴”在大学里由 Bertrand Meyer 本人教授 Eiffel,并且刚刚读到 .NET 4.0 将包括合同设计。
任何有洞察力的人都可以详细说明与 Eiffel 现有的功能集相比,它的功能有多强大吗?
是否支持接口合约?
I had the "pleasure" to be taught Eiffel at college by none other than Bertrand Meyer himself and just read that .NET 4.0 will include design by contract.
Can anyone with some insight elaborate on how powerful this will be compared to Eiffel's existing feature set?
Will contracts for interfaces be supported?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
没有使用过 Eiffel,我无法评论比较,但我已经搞乱了 Spec#,它是按合同设计的,并且(大部分)被纳入 C# 4.0,我可以这样说:
这真是太糟糕了强大的。
Not having ever used Eiffel I can't comment on the comparison, but I have messed around with Spec#, which has design by contract and is what is (mostly) being rolled into C# 4.0, and I can say this:
It's pretty darn powerful.
它允许您指定“设计时断言”,编译器会警告您可能违反约束。
这里有一篇博客文章对此进行了一些解释,带有 Channel9 详细解释的链接。
It allows you to specify "design-time asserts" and the compiler will warn you that you might violate the constraint.
Here's a blog post that explains it a little, with a link to a Channel9 detailed explanation.