Circuit Breaker
A Circuit Breaker’s trip trigger and recovery strategy must be designed together. Trip without recovery cuts the dependency permanently; recovery without a trip basis becomes meaningless cycling.
A Circuit Breaker’s trip trigger and recovery strategy must be designed together. Trip without recovery cuts the dependency permanently; recovery without a trip basis becomes meaningless cycling.
Before choosing a rate limit algorithm, the protection layer decides which algorithms are even available. This post lays out how L4/L7/Application layers and Token/Leaky/Sliding/Fixed algorithms intersect.
Builder is the answer when three limits of constructors meet at once — many parameters, some optional, and step-wise validation. With fewer than all three, simpler tools suffice. When the language provides rich named/default parameters, the need for Builder shrinks as well.
Factory’s shared intent is separating creation from use. The three variants — Factory Method, Abstract Factory, and Static Factory Method — split creation differently and suit different conditions. Static Factory Method is the variant most often encountered in practice, and DI containers absorb part of Factory’s explicit role.
Singleton is one of the simplest patterns but the canonical anti-pattern debate. The decision to bundle single-instance guarantee with global access into one pattern causes tight coupling and test difficulty. DI is the general alternative that separates the two intents.
DIP (principle), IoC (pattern), and DI (technique) sit at different levels of abstraction. The hierarchy must be clear before framework features and design principles can be told apart.