Humble Objects And Functional Core

Splitting a component into the part that decides and the part that acts, so the decision is pure, deterministic and cheap to test while the effectful part stays thin enough for a small set of boundary/integration tests—the Humble Object pattern and the functional core / imperative shell shape of the same idea. Use when a rule can only be exercised by standing up the framework because the decision lives inside the component that performs the effect, when logic sits in a controller, scheduler, message listener or UI component, when a test needs a mocking framework to reach the branch it cares about, or when retry, fallback or routing policy is entangled with the call it governs. Does not cover which test level to use (architecture-testing, java-testing-strategy), choosing and writing the doubles themselves (java-test-doubles), where business rules belong across layers (domain-logic-organization), the mechanics of immutable types (java-immutability), or module dependency direction (layering-and-boundaries).

robsonkades 8c8c215 4 files · 39.9 KB Updated

File contents

robsonkades/agent-skills/tree/main/skills/humble-objects-and-functional-core commit 8c8c215dc7

Frequently asked questions

npx skillmds@latest add robsonkades/humble-objects-and-functional-core