Mรณdulo 27 ยท Design Patterns (All 23 GoF) โ Lecciรณn 3 de 23 ยท ~6 min
Abstract Factory
Build a whole family of matched objects
Where Factory Method makes one product, Abstract Factory makes a family of related products that must go together. For payments you need a matched pair: a charger and a refunder. A Stripe charger must be paired with a Stripe refunder โ never a PayPal one.
The abstract factory hands you a coherent set. Pick Stripe once and you get the whole Stripe family; you can't accidentally mix providers.