Code Contract brings this programming paradigm to.net.
代码契约为。NET引入了这种编程范式。
Whereas an assertion tells you only about a detected bad symptom, a Code Contract can show invaluable information on how the method should be used.
而断言告诉您只对检测到的不良症状,则代码合同可以显示宝贵的资讯应如何使用该方法。
It is transparent because the business-logic code contains no reference to contract checking; it is absolutely unaware of it.
它是透明的,因为业务逻辑代码不包含对契约检查的引用,前者绝对不知道后者。
When you're writing code, think about the contract — the particular bit you're writing will expose to its client, whether it's a method, a class, or a group of interacting classes.
当编写代码时,应考虑到这个契约——您将要编写的特定内容都将暴露给它的客户机,无论此内容是一个方法、一个类,还是一个与类交互的组。
Not according to the contract of the process interface. That only requires that code be accompanied by tests.
不一定要按照过程接口的契约,只是要求代码都有单元测试。
Using different design contract management protocols provides different levels of management and control of the design model and the implementation code.
使用不同的设计合约管理协议,提供管理的水平,并控制设计模型和实现代码。
The design illustrated in Figure 1 guarantees a highly flexible solution that lets you apply and remove contracts without changing either the contract implementation or the application code.
图1所展示的设计保证了高度灵活的解决方案,它使您可以不用改变契约实现或者应用程序代码就可以应用或者删除契约。
Rewriting code alters the behavior and even the contract of code, while refactoring preserves its outward interface.
重写代码会修改代码的行为甚至合约,而重构保持对外接口不变。
Design by contract avoids extra code and improves performance, as long as all clients of a class abide by the contract.
契约式设计避免了额外的编码并提高了性能,只要所有的客户都遵守契约。
These primary two features — access control and contract programming — allow for much larger teams of coders to work on much larger code bases more smoothly.
这两个主要特性——访问控制和契约编程——允许大型编码人员团队更顺畅地使用大型代码库。
The tool must adhere to a strict contract: the resulting code must still work just as it did before.
工具必须严格遵合同:生成的代码必须能够和以前一样工作。
Provides the tools needed to view the Business Contract model and develop service realization models that can be used to generate implementation code for different architectural styles.
提供了观察BusinessContractModel所需的工具,以及开发可以用于为不同的架构风格生成实现代码的服务实现模型所需的工具。
Although this Web service has been valuable for various assessment purposes, once architects take a closer look at the actual Web service contract code, they detect some content that raises concerns.
尽管该Web服务对很多评估需求价值很大,可是一旦架构师们仔细检查其实际的契约代码,他们发现了一些应被关注的内容。
An object that ACTS as a bridge between the code and the contract, capable of applying the contract in the right part of the code and with the correct logic.
一个作为代码与契约之间桥梁的对象,可以将契约应用到代码中正确的部分中并有正确的逻辑。
This allows parties to set conditions and rules, similar to a dynamic contract, but via these GK code snippets.
这就允许团体设置条件和规则,与动态契约类似,只不过此处是通过这些GK(即Gatekeeper)代码片段来设置。
If you are writing the server-side code and the client-side code based on a machine-readable contract such as a WADL document, the coding flow may be as follows.
如果你正在编写基于机器可读契约(如wadl文档)的服务器端代码和客户端代码,编码流程可能如下。
To do this, you'd need to modify the source code for Order and Contract to implement the new interface.
要做到这一点,您需要修改Order和Contract的源代码,以便实现新的接口。
That contract does not allow this method to throw a run-time exception (barring violations of generic type safety that qualify as bugs in the calling code).
这个合约不允许该方法抛出运行时异常(防止因违反泛型类型安全而成为调用代码中的bug)。
Many APIs that expect explicit constants or 'magic values' are part of an API contract and not merely some value added in to the code.
需要显式常量或是“魔力值”的很多API都是API契约的一部分,这些常量或数值并不只是随意添加到代码中的(这里的意思指的是很多API中都拥有一些常量或是数值,他们是API契约所要求的,因此根据反编译后的结果很难推测出这些常量或数值所代表的含义——译者注)。
It also explains the difference between programming by contract and defensive programming with a clever situation where your customers request that the framework code do the checking.
该书还阐述了在客户请求框架代码进行检查的智能情况下,承包程序设计和防错性程序设计之间的差别。
This might be the case when you are developing software under a contract that will deliver the source code and documentation to the customer.
这是你在向顾客释放源代码和文件的契约下开发软件时可能遇到的情况。
Tools can easily generate code from such a formal contract that makes the use of SOAP and XML transparent to the client and server-side code.
这种正式约定使SOAP和XML的使用对客户端代码和服务器端代码透明,工具可以方便地从这种正式约定生成代码。
One of the biggest advantages of using Rational Software architect V7.0 is the ability to synchronize your evolving architecture and design contract models your evolving code bases.
使用Rational Software ArchitectV7.0的一个最大的优势是同步您的演进架构与建模您的演进代码的设计规约的能力。
If everyone fully understands and adheres to the contract of the functions of a particular DLL, shouldn't updating that DLL in theory not break any code?
假如每个人都完全理解并且遵循特定dll的功能契约,那么在理论上,是否不应该升级dll,以避免对某些代码的破坏?
Subject to the mandatory laws described above, the Code provides that parties may agree to select the laws applicable to their contract.
除了如上所述的强制性法律,该法规定,当事人可以协议选择合同适用的法律。
Another solution is to design code that avoids side effects in reference types wherever possible unless those changes are part of the contract that the called code is fulfilling for the caller.
另一个解决方案是设计代码,尽可能避免副作用在引用类型,除非这些变化是合同的一部分,被调用的代码是调用者实现。
Upon commencement of the contract, a copy of Code documents will be downloaded by each registered site.
合同生效后,可以通过各注册网站下载规范文件副本。
China Maritime Code provides a definition for carrier, i. e. the party who concludes the contract with shipper.
就承运人识别问题,中国《海商法》对承运人概念作了明文定义,规定承运人是与托运人订立合同之人。
Part 1 starts simply, explaining the basic concepts behind web services and showing you how to develop web service with Axis2 using Different Approach (Code First and Contract First).
第1部分从简单的内容开始,先解释了Web服务背后的基本概念,并展示了如何使用Axis2运用不同的方法(代码优先和契约优先)来开发Web服务。
As regard its legislation model, an expedient is to admit its rationality and justice by judicatory interpretation, an ideal one is to prescribe it as a named contract in the debt part of civil code.
隐名合伙的立法模式选择,权宜之计是通过合同自由的司法解释承认其存在的合理性与正当性,理想方案则是将其作为一种有名合同纳入民法典债编。
应用推荐