+Once having discovered these features, we want to refactor some ad hoc features to minimise code duplication by redesigning the class hierarchies. In this work in progress, we propose to redesign class hierarchies by pulling up methods, replacing inheritance with delegation, and introducing a systematic and consistent type hierarchy (i.e., interposing interfaces between client code and the class hierarchies). We first illustrate our intuition using various real-world examples and then propose an approach that selects certain ad hoc features, which should be refactored according to some criteria, and then suggests refactoring opportunities to transform these ad hoc features into deliberate features. This approach thus reduces code duplication while maintaining the type hierarchy.
0 commit comments