August 2012
Intermediate to advanced
318 pages
5h 56m
English
Eliminating code duplication is not always easy, but there are some pretty straightforward refactoring techniques that help in resolving such problems. Once duplicated lines are recognized, the next step is to examine whether the duplicated code could be simply eliminated and replaced with a method call. If this is not viable, then we could resort to the Extract Method refactoring practice.
For long parts of duplicated code, we could remove the duplication by moving functionality and code to a single shared place inside our project. All parts of our program could then utilize this shared part of code instead of duplicating it.
From Martin Fowler's Refactoring ...
Read now
Unlock full access