← Graph

dry-container

tool 4 connections

Inversion-of-control container from the dry-rb family. Ivan recommends using it to centralize swappable external-dependency implementations: register a global config container in an initializer, add stub implementations for the test environment and real ones for development/production, then resolve at the call site. Keeps payment adapters and similar collaborators out of the call stack and avoids relying on discipline to prevent stateful service objects. Ivan acknowledges it is a global, but argues the purpose (single place for replaceable implementations) justifies the dirty trick.

category
library
about
dry-container tool
Recommends dry-container for swapping external dependencies per environment.
about
dry-container tool
Recommends the dry-container tool.
about
dry-container tool
Challenges dry-container's use of a global container.
recommends
dry-container tool
Recommends dry-container for concentrating swappable dependency implementations.

Provenance

Read by
20 extractions