它没有引入可重用的验证代码。
TDD是为了设计并验证代码。
此处显示的代码示例中已删除参数验证代码。
Parameter validation code has been removed from the code sample shown here.
您甚至可能同意验证代码不属于视图层的说法。
You may even agree with the argument that validation code doesn't belong in the view layer.
您的验证代码很醒目,是因为它看起来不像周围的其他代码。
Your validation code sticks out because it doesn't look like the other code around it.
一个选择就是把验证代码放到“Service”层中。
One option is to place your validation logic in a service layer.
这就意味着您可以给验证规则编码,速度比自己编写验证代码快得多。
This means you can encode the rules a lot faster than writing the validation code by hand.
实际上,无需离开浏览器,您就能够验证代码对httpd执行的操作!
In fact, you'll be able to verify the operations your code is having on HTTPD without leaving your browser!
添加验证代码可以帮助您更迅速地捕获可访问性错误,而不必检查整个报告。
Adding validation code could assist you in catching accessibility errors more quickly, without having to examine an entire report.
与紧密耦合方法不同,使用动态代理给您带来了可以重用、可以配置的验证代码。
Unlike a tightly coupled approach, using dynamic proxies leaves you with validation code that is reusable and configurable.
虽然不理想,但是紧密耦合的验证代码相当普遍,特别是在比较老的应用程序里。
Although not ideal, tightly coupled validation code is quite common, particularly in older applications.
通过添加一些简单的验证代码来继续增强清单3内的php代码,如清单4所示。
Continue adding to the PHP code in Listing 3 by inserting some simple validation code, as in Listing 4.
或者您可以将所有验证代码移入到服务层,然后从应当是该知识所有者的域类中删除它吗?
Or do you move all the validation code into the services tier, removing it from the domain class that should be the owner of that knowledge?
切换到JSPSource页签,并验证代码(也可以参见图 37中的屏幕输出
Switch to the JSP Source tab and verify the code (also see the screen output in Figure 37)
除了每个实现类,Castor还生成描述符(descriptor)类,该类包含绑定和验证代码。
Along with each implementation class, Castor also generates a descriptor class that contains the binding and validation code.
根据所需验证的数量和性质,验证代码可能复杂冗长,而且在越来越多人参与其中后,维护将成为沉重负担。
Depending upon the number and nature of the validations required, the validation code can be complex and lengthy and its maintenance can become a significant burden as more partners are added.
在项目生命周期中,质量确保工具是用来验证代码开发的,变更及资产管理工具是用来跟踪应用程序修改的。
Quality assurance tools and change and asset management tools are also needed to verify code development and track application modifications, respectively, throughout the project lifecycle.
特别是对于数据格式验证代码,我们认为处理它的最佳方法是使它接近客户机,这样可以使处理开销保持最少。
Specifically, we decided the best way to deal with data-format validation code was to keep it close to the client, thus keeping the processing overhead to a minimum.
请注意,在下面的invoke方法中的验证代码,几乎与清单3中的代码完全一样。实际上,在这里可以使用与前面完全一样的验证器服务。
Notice how the validation code in the invoke method below is nearly identical to the code from Listing 3; in fact, I could use the same validator service here as I did earlier.
如果数据库具有验证代码,这些代码要求在保存文档之前,各个字段都必须填写完整,并且如果还未填写完整就试图保存文档会产生各种错误,该怎么办?
What if your database has some validation code that requires various fields to be filled before the document can be saved, and will produce all sorts of errors if you try to save before that?
本文展示了SQLObject如何与数据库交互,如何使用SQLObject编写数据库访问和数据验证代码,以及如何将它用于遗留或现有数据库。
This article shows you how SQLObject interacts with a database, how to use SQLObject to write database access and data-validation code, and how to use it with legacy or pre-existing databases.
从另一方面讲,OVal很容易使用,对约束条件也有很大的选择余地,若想要花少量力气就可向代码添加验证约束条件,它无疑是个上佳之选。
On the other hand, OVal's ease of use and wide selection of constraints make it a viable option for adding validation constraints to code with little effort.
该特性可以验证响应代码,以及与响应相关的内容。
This feature can verify the response codes and the content associated with responses.
测试验证所生成代码是正确的。
但是,如果架构坚持执行验证的代码必须来自一个服务层,那么会发生什么呢?
But what happens when the architecture insists that the code that performs the validation must come from a services tier?
试图在编译阶段验证动态代码会使你陷入停机问题的漩涡。
To try to verify dynamic code at compile time would likely walk you straight into the halting problem just like it would for many kinds of tooling.
即使适当地采取了这些安全性措施,也并非所有通过字节码验证的代码都被允许运行。
Even with these security measures in place, not all code that passes bytecode verification should be allowed to run.
代码3:验证FTP自动下线功能。
代码5:验证telnet自动下线功能。
应用推荐