TLDR Web Dev · MISCELLANEOUS
DEPENDENCY COMPOSITION
Summary from the TLDR Web Dev newsletter
Frustrated with conventional framework-based dependency injection, Daniel Somerfield, a software engineer with over 20 years of experience, has developed a composition strategy that utilizes partial application to inject context into modules. This article provides a first-person view of how Somerfield identifies and solves a technical problem within his team. By opting to fulfill dependency contracts with functions instead of classes, minimizing code sharing between modules, and guiding the design through tests, Somerfield successfully created a system composed of highly discrete, evolvable, yet still type-safe modules.