Normally, the check method of binary is not suitable to the multiple value data. The duplication code and complementary code given in the paper can be applied to check arbitrary value data.
一般二进制校验方法不适用校验多值数据,给出的重复码和互补码,可适用于任意值数据校验。
This rule, and the rule to do one thing, are both corollaries of an underlying principle: avoid duplication of code whenever possible.
这条规则,以及做好一件事情的规则,都是一个根本原理的必然结果:无论何时都要尽可能避免代码重复。
You can reduce code duplication by abstracting the common behavior and including it in the generic DAO, where all users of the class will have access to the functionality.
提取通用行为并把它们包含在泛型DAO 中,让类的所有用户通过泛型 DAO访问这些功能,这样就可以减少代码重复。
Duplication harms projects because it resists attempts to make structural changes or refactor toward better code.
复制对项目有害,因为它不利于做出结构更改或重构为更好的代码。
Duplication in code obscures the design because you can't find idiomatic patterns.
代码复制使设计变得更加模糊,因为您无法找到惯用模式。
At first glance, this strategy seems like a good idea — code duplication is a bad thing, so consolidating these duplicated paths should be an improvement.
乍一看,该策略似乎是一个好方法——但代码副本有错误,所以整合这些复制路径应该是一种改进。
This kind of structure is an example of a bad "code smell" in that it relies upon duplication.
这种结构是坏“代码味道”的一个例子,原因在于它依赖于复制。
This enabled me to avoid code duplication more elegantly than I could have with a procedural language.
这使得我可以避免代码重复,从而比使用过程语言更为优雅。
The measure for finding duplicated code is to search for code duplication within classes and among other classes in the code base.
查找重复代码的度量方法是在代码库中的类的内部和其他类之间搜索代码重复。
This can be tedious to maintain because it imposes a duplication of code.
这样维护起来会非常繁琐,因为代码是重复的。
Creating intermediate facts is a useful pattern to avoid duplication of rule code.
要避免规则代码的复制,创建中间事实是一个很有用的模式。
Although they all emphasize different aspects of clean code, there are a few emerging themes: simplicity, lack of duplication, readability, elegance.
虽然他们定义简洁代码的侧重点不尽相同,但其中仍有共通之处:简单、无重复、易读、优雅。
You can, however, refactor without performing TDD and still banish duplication while making the code simpler, easier to understand, and more flexible.
当然你也可以不执行TDD方式,而进行重构以去除重复代码,使其更简单、灵活、更易于理解。
Another important principle is that in the first case we don't mind having some duplicate code. If it's clear how to eliminate duplication, we do, but we are willing to wait for clarity.
还有另一个重要的原则,在第一个案例中我们不介意有一些重复的代码,如果能够明确如何消除重复代码,我们愿意这么做,但现在还没有,我们仍然希望能找到清晰的解决方案。
Listing 9 shows a pattern that I introduced in "Leveraging reusable code, Part 2" under the guise of removing structural duplication.
清单9显示了我在“利用可重用代码,第2部分”中引入的一个模式,它以删除结构性重复为名义。
Over time you will start to see patterns and duplication across code fragments and application functionality which will help achieve synergies.
随着时间的推移,你会看到多个代码片段和应用功能中存在的模式和重复的代码,这对起到增效作用很有帮助。
And just as code duplication can make a software program more difficult to maintain, so too does duplicate code in build scripts.
代码复制令软件程序更难于维护,同理,构建脚本中的复制代码也存在这样的问题。
This duplication doesn't appear in tools like CPD because the values in each instance of the repeated infrastructure are indeed unique, but it harms your code nonetheless.
这种复制并不会出现在CPD之类的工具中,因为重复的基础设施的每个实例的值必须是惟一的。尽管如此,它仍然会损害您的代码。
Named templates are particularly useful for dividing your code into smaller chunks and avoiding code duplication.
命名模板对于将代码划分为较小的区块、避免代码内容重复非常有用。
CPD报告代码重复。
The generic DAO pattern (also called Typesafe DAO) is critical to reducing code duplication in the data access tier.
泛型dao模式(也称为类型安全的DAO)对于减少数据访问层中的代码重复非常重要。
CPD: a freely available code duplication tool from the PMD team.
CPD:来自PMD小组的免费代码复制工具。
This article's code examples (see Download to obtain the full package) show how to use these interfaces to facilitate auditing and reduce code duplication in data access objects (DAOs).
本文的代码示例(在下载中可以获得完整的代码包)演示如何使用这些接口帮助执行审计和减少数据访问对象(DAO)中的代码重复。
Reducing code duplication in the data access tier.
减少数据访问层中的代码重复。
This logic in the session bean will force the clients to always do the right thing, ensuring consistency in the application and preventing code duplication at the client side.
会话bean中的这个逻辑将强制客户机一直做正确的事情,确保应用程序中的一致性并防止客户端的代码重复。
Catching code duplication with CPD.
用CPD捕捉代码重复。
You might think that storing the strings in an ArrayList would make the code simpler, easier to understand, and avoid duplication, but you might also choose to defer this decision for now.
你可能认为在ArrayList中存储字符串可以使代码更简单,容易,更利于理解,同时避免重复,但是你也可以选择其它解决方案。
There's a bit of code duplication in the Person class, but I'll leave that for a later refactoring exercise.
在person类中有一些重复的代码,但我把它留给稍后的重构练习。
PMD's CPD: Enables discovering code duplication
PMD的CPD:帮助发现代码重复
The solution to this type of duplication is to refactor the code into a single Factors class, which appears in Listing 3.
去除重复的解决方案是将代码重构为一个单一的factors类,如清单3所示。
应用推荐