ConstructiCat Logo
CodeBust.
Browse section ▾

Shotgun Surgery.

Making any modifications requires that you make many small changes to many different classes.

##Signs and Symptoms

Making any modifications requires that you make many small changes to many different classes.

class User { String phone; }
class UserForm { String phone; }
class UserDto { String phone; }
class UserRow { String phone; } // one new field, four classes

##Reasons for the Problem

A single responsibility has been split up among a large number of classes. This can happen after overzealous application of Divergent Change.

##Treatment

##Payoff

  • Better organization.

  • Less code duplication.

  • Easier maintenance.