← Graph

Fat Model Thin Controller

concept 3 connections

Long-standing Rails convention of putting business logic in ActiveRecord models (with lifecycle hooks like before_update/after_create) and keeping controllers thin. Rafael Zamaris cites fat-model thin-controller as a historical Spree design choice that contributed to maintainability problems, encouraging users to monkey-patch private methods on core models (e.g. OrderContents#add_to_line_item) to customize behavior — which service objects with dependency injection later replaced.

category
pattern
about
Fat Model Thin Controller concept
The takeaway critiques the fat-model-skinny-controller convention.
about
Fat Model Thin Controller concept
Identifies fat-model thin-controller as a historical design that complicated Spree maintenance.
about
Fat Model Thin Controller concept
Argues, using the distance-from-main-sequence quadrants, that fat-model-skinny-controller is a fundamental Rails design mistake.

Provenance

Read by
4 extractions