Question OOP-SOLID-0062
HardA discount calculator has a growing switch on customer type, edited for every new type. Which refactoring follows Open/Closed?
- A.
A DiscountPolicy interface with one class per customer type, chosen through a map or factory
- B.
Using global variables
- C.
Sign up free to see the answer and a step-by-step explanation.