Duplicate Feature

classes have become coupled due to the unique implementation of a feature
duplicate the feature to decouple the classes

Context:

When the uniqueness of a feature implementation adds undesirable coupling among components the disadvantages of its uniqueness can outweigh those of having the feature duplicated. In such cases it makes sense to duplicate the feature implementation during the course of the ongoing refactoring.

The Duplicate Feature refactoring makes a trade: It removes the undesired dependency at the cost of duplication. Doing so allows to proceed with the dependency problem but leaves the duplication smell to be resolved by later refactorings such as Eliminate Duplication By Composition and Eliminate Duplication By Inheritance.

See also: Pull Up Feature, Push Down Feature, Introduce Duplication


Refactoring Thumbnails, Copyright © 2004 - 2005, Sven Gorts, All Rights Reserved.

[ Overview Page ] [ Thumbnail Catalog ]