Category
1 article in this category
TLDR: If your code is full of if (type == A) doThis() else if (type == B) doThat(), you need the Strategy Pattern. It allows you to define a family of algorithms, encapsulate each one, and make them interchangeable at runtime. What is the Strategy ...