Skip to content

Techniques: organizing data

Refactorings that give data a name, a type and a single purpose: replace primitives and magic numbers, encapsulate fields and collections.

5 guides34 min in totalRefactoring

The guides, in order

Read them top to bottom: each one builds on the ones before. The ones you've read carry a check.

About this group

What you'll find
Replace temp with query, split variable, replace primitive with object, introduce parameter object and preserve whole object.
It's for you if…
your functions take loose strings and numbers that are really money, emails or ranges.
How each guide works
Smell guides cover the signs, an example, why it happens, the treatment with its refactorings, what you gain and when it's not worth fixing. Technique guides show the problem, the code before and after, the steps, which smells it removes, its benefits and its cautions.