The Strategy Pattern in Java — Replacing Conditional Dispatch With Polymorphism
- Published
- Author
Eric HansonBackend Developer
Conditional dispatch — switching on a type or status to select behavior — is the most common source of rigid code in Java applications. The strategy pattern replaces the switch with polymorphism, but the right implementation depends on what varies and how often it changes.
Read more