OOP and Design Patterns · Real-world situation · Intermediate
Modelling discounts with inheritance or composition
You are modelling discounts: percentage, fixed amount, buy-one-get-one, and combinations like "10 percent off, but only for members on weekends". Would you use inheritance or composition?
2:00