Consolidate Abstraction | |||
| |||
Context: One of the reasons code duplication is problematic is because code fragments that remain duplicated for to long tend to diverge over time. A little fix here, a few tweaks there and eventually the code has become so degraded that the similarities are barely recognizable. Consolidate Abstraction counters such design decay and let's you preserve the higher level design. Opportunities to Consolidate Abstraction without the need for further preparation rarely occur within a design. Before being able to consolidate each of the differences among the components needs to be resolved using preparatory refactoring steps. For example: Extract Variation. Consolidate Abstraction is a contraction step that naturally follows Eliminate Duplication By Composition possibly in combination with Enable Substitution With Interfaces. |