Code Modularity and Boundary Enforcement
Focus On Behavior, Not State, for a More Maintainable Codebase - Shopify

Focus On Behavior, Not State, for a More Maintainable Codebase - Shopify

9/1/2022

What this post added

This post introduces a strategy of focusing on behavior over state to improve code maintainability. It details how to wrap domain objects (like 'selling plans') to expose behavior-oriented methods rather than direct state access. This reduces conditional logic and leaks of internal implementation details to other parts of the codebase. The post also discusses how to translate these behavioral abstractions into a format suitable for data teams by creating a translation layer (a new table) to insulate reporting from internal schema changes.

Read the original post ↗