Let's refactor this code a bit.
让我们稍微对该段代码进行重构。
So I'll refactor this method, with composed method in mind, to see if I can isolate the atomic parts.
因此,我将根据组合方法模式重构这个方法,看看是否可以分离出原子性部分。
This is the code I ultimately refactor into its own idiomatic pattern in "Leveraging reusable code, Part 1."
这就是在“利用可重用代码,第1部分”中我最终重构到它的惯用模式中的代码。
To make this program double-buffered, you need to refactor the code slightly.
为了让这个程序进行双缓冲,需要对代码略加重构。
With this step, you refactor the code that causes the problem.
在这一步中,您将重构导致问题的代码。
This partitioning of code by functionality makes it easy to identify particular responsibilities, refactor, and maintain.
这种通过功能划分代码的方式使我们更易识别特定职责、进行重构和维护工作。
If you're already building code this way, you can better recognize and refactor bad implementations.
如果您已经在用这种方式构建代码,那么您就可以更好地识别和重构不好的实现。
Therefore, if this is true — and I'm quite sure it is true — the stop to refactor strategy is never the best one for a team skilled enough in refactoring.
因此,如果这是对的——我也非常确信它的正确性,那么对于已经精通重构的团队来说,“停下来重构”策略从来就不是最佳策略。
When we refactor the code this way, we realize that we don't really care about observing buttons; we care about observing clicks.
当我们开始用这种方式重构代码的时候,我们意识到我们实际上不关心“观察”按钮;我们关心的是“观察”点击。
I hope this will prove useful for anyone that still has a doubt on true nature of refactoring, to anyone learning to refactor or working on establishing and spreading this practice inside his team.
我希望本文能为每个人澄清对重构本质的怀疑,让他们学会成为一个重构者,或者在他的团队中建立并推广这种实践。
When you choose Refactor rename, all reference to this name will be changed.
当您选择Refactorrename时,所有这个名称的参考都会更改。
This makes CodeIgniter the perfect choice to refactor a legacy PHP application, in which you may have all kinds of crazy structures that need porting over.
这使CodeIgniter成为重构遗留PHP应用程序的理想选择,在此类遗留应用程序中,可能存在需要移植的所有奇怪的结构。
This solution helps us get the code quickly into WebSphere Studio, where the refactoring process is very easy — and working code (in any form) is easier to refactor than non-working code.
这个解决方案帮助我们快速的将代码导入WebSphereStudio,它使得重构过程非常容易——并且能工作的代码(无论什么形式)比不能工作的代码更容易重构。
This is similar to trying to answer the question "how can I refactor my code and how much refactoring is appropriate for a given situation?"
这与试图回答“如何重构代码,在给定情形下多大程度的重构才是合适的?”
Next, I need to refactor the section of code that previously wrote to a file — this time with logic to populate a list with the new ChecksumClass, as shown in Listing 16.
接下来,我需要重构刚才写入文件的那段代码——这一次采用一定的逻辑使用ChecksumClass构造一个列表,如清单16所示。
The solution to this problem is to refactor with a modified model-view-controller that is more appropriate for servlet-based programming.
这个问题的解决方案是使用一种修改过的、更适合基于servlet编程的模型-视图-控制器来进行重构。
Refactoring: Refactor out any duplicate code generated in a coding session. You can do this with confidence that you didn’t break anything because you have the tests.
求精(Refactoring):去掉在编码过程中产生的任何重复代码,你可以自信地认为这么做不会破坏任何东西,因为你还有测试作为后盾。
That suggests that this method shouldn't be in this class, so I'm going to refactor it upward to a BoundaryBase class, which ACTS as the parent of the PartDb class.
这说明这个方法不应该放在这个类中,所以我要把它重构到partdb类的父类BoundaryBase中。
Describing the changes to the files necessary to refactor the Blether code would add no value to this article, as the IDE takes care of them for you.
描述重构Blether代码所需的文件更改对于本文来说没有任何价值,因为IDE会为您料理这一切。
Now let's refactor the test to use a general purpose mocking framework. We do this by adding a single script tag to the test page and rewriting the test like this.
现在让我们重构测试,使用一种通用的mocking框架。
In some cases, you may need to refactor your application logic to support this transaction strategy.
在某些情况下,您可能需要重构应用程序逻辑,以支持这种事务策略。
In part 3, you'll refactor the rock star application built in this part.
在第3部分中,您将重构本文所建立的摇滚巨星应用程序。
Doing this puts your test data in one place and makes your code cleaner and easier to refactor.
这样做使得测试数据放在一个地方,从而使代码更干净,更容易重构。
Once I have extracted this class, I can refactor both the functional classifier and prime-number tester to use it.
一旦提取了该类之后,我就能通过同时重构函数分类器和质数检验器来使用它。
In these cases you may need to refactor your orchestration or processing logic to avoid this scenario.
遇到这些情况时,需要重新构造结构和处理逻辑以避免发生此类问题。
If that's true, then this strategy will deliver value uniformly faster than the stop to refactor strategy.
如果确实如此,这种策略交付的价值会显著大于“停下来重构”的策略。
We understand that this will be a temporary solution and that the next phase of the project must be to refactor these dependencies out of the application code.
我们知道这将是临时的解决方案,在项目的下一步必须重新从应用程序代码中提取出这些依赖关系。
It is at this point that the seasoned programmer would tell you it's time to refactor, that is, to place the responsibilities of a system at their correct level and abstract out common functionality.
有经验的程序员就会在这个时候指出重新整理要素的时候到了,即,将系统的职责置于它们正确的层并且提取共同的功能性。
If the whole application is written assuming this data will be available in memory, a major refactor is in order.
假设在编写应用程序时这些数据在内存中可用,那么将要执行较大的重构。
In this way the total percentage of software in the enterprise that is service oriented can grow incrementally over time without having to fundamentally re-architect or refactor as you go.
通过这样,企业中面向服务的软件的百分比将随着时间的增加而增加,而不必在以后重新进行体系结构设计或重构。
应用推荐