jargon

Comparison

Package by featurevsShotgun surgery

Package by feature

one change touched one folder, instead of the same change touching the controllers, services and repositories folders.

Grouping code by the capability it serves rather than by its technical role, so a feature's handler, model and storage live together. It aligns the physical structure with the direction changes actually arrive from, and it makes package-private visibility useful again because a feature can hide its internals. Packaging by layer optimises for the rarer case — swapping an entire technical layer at once.

Full entry →

Shotgun surgery

adding one field meant small edits in eleven files, and the review caught the two you missed.

The inverse of divergent change: one conceptual change requiring small edits scattered across many modules, because the concept has no home. It is the most reliable measure of bad decomposition, because it shows up as effort rather than as opinion. The fix is to gather the scattered pieces into one place, which is exactly what package-by-feature is arguing for at a larger scale.

Full entry →

Related comparisons