Bad Smells: Hosting the change


Some problems become more apparent when you try to change the code. Ideally, a change decision affects only a single location. When this does not happen, it is a sign of code duplication. Detecting these problems usually has other benefits such as facilitating the testability of the code.

Bad smells related to forced simultaneous switching between classes are:

Divergent Change

Symptoms

The same class needs to change for different reasons.

To do

Rewards

Shotgun Surgery

Symptoms

Making a change involves modifying several classes.

To do

Rewards

Parallel Inheritance Hierarchies

Symptoms

To do

Use Move Field/Method to redistribute the features in a way that you can eliminate one of the hierarchies.

Rewards

Combinatorial Explosion

Symptoms

To do

Rewards

2019-03-20
Written by Samuel de Vega.
Tags