Codemanship's Code Smell Of The Week - Data Clumps
Codemanship's Code Smell Of The Week - Data Clumps
Submitted by jason@parlezuml.com (Jason Gorman) on Thu, 15/07/2010 - 14:49.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.
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.
