← Graph

Mutator Layer

concept 6 connections

Ivan Nemytchenko's proposed layer between services and Active Record. A mutator is a plain procedure (module or class of functions) handling a single purpose — creating, editing, or deleting records — as an atomic operation so callers never see half-baked entities with unfilled associations. Services call mutators to persist results instead of touching Active Record directly, keeping services focused on business logic and external interactions. Mutators can absorb counters/denormalization code previously expressed via callbacks, and effectively replace callbacks entirely by making the full creation procedure explicit. Complements the 'lazy' progression: simple cases stay in the controller; medium cases add a mutator; complex cases add a service that orchestrates mutators, managers, and jobs.

category
architecture
about
Mutator Layer concept
Introduces the mutators layer as the home for atomic create/edit/delete operations.
about
Mutator Layer concept
Ivan proposes the Mutator layer as the right shelf for complex creation/edit/delete procedures.
about
Mutator Layer concept
Mutator layer is one of the shelves Ivan proposes.
recommends
Mutator Layer concept
Ivan proposes the Mutator layer as the only genuinely new layer on top of Rails defaults.
concept Mutator Layer
related_to
Active Record concept
Mutators encapsulate Active Record creation/edit/delete so services don't touch persistence directly.
concept Mutator Layer
related_to
Mutators are called by stateless services to handle persistence.

Provenance

Read by
7 extractions