Home  /  Questions  /  Question

50   50
May 18, 2010

Is there a Design Pattern for Mix'N'Match Special Offer?

I am trying to develop a solution which includes a special offer Mix'N'Match functionality. That is to say where customer buys three specific items they get a discount.

I have used a collection to ensure all items are there, but struggling where multiple items are involved. For instance, orders 2 of 2 items and three of another, should get the discount offer applied for two of these but pay full price for the third.

Is there a Design Pattern which is ideal for this situation? I was thinking Decorator but this doesn't seem quite right for this problem.