Eliminate Duplication By Composition

unrelated classes host duplicate code that presents a responsibility of its own
capture the missing responsibility with a class and factor out the duplication by means of composition

Context:

When a new abstraction has been recognized Eliminate Duplication By Composition can be used to Consolidate Abstraction and prevent the similarities from diverging.

See also :Eliminate Duplication By Inheritance


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

[ Overview Page ] [ Thumbnail Catalog ]