Take any problem where there are rules and n exceptions to those rules. All salesmen get cost * x% commission on an item EXCEPT when it's a a) our annual year end sale then they get y% or b) when it's an internet sale then they get z%.
That's the pattern to all this, rules and exceptions and how easy it is to change those rules (because they change constantly).
So do you put all that into your SalesPerson object or is there a better way to abstract the logic of commissions?
That's the pattern to all this, rules and exceptions and how easy it is to change those rules (because they change constantly).
So do you put all that into your SalesPerson object or is there a better way to abstract the logic of commissions?