Skip navigation.

Codemanship's Code Smell Of The Week - Data Clumps

Codemanship's Code Smell Of The Week - Data Clumps

When we see fields that always seem to be used together (e.g., passed together as mathod parameters, or used together in methods), this gives a strong indication that these fields really belong in their own class.

Jason Gorman (yes, that's me) illustrates how to refactor a data clump by extracting a class containing those fields and then moving the behaviour that accesses them into the new class.