jeudi 7 avril 2016

Which design pattern would be suitable for my scenario?

I want to be able to have multiple pizza bases, then allow the user to pick none or multiple toppings, the description and cost are altered as more toppings are added.

Also want to be able to remove toppings, not just the last one added, but maybe the highest costing etc

What would be ideal for this scenario? I tried the decorator which worked well for bases and toppings but it was very difficult to remove toppings.

What others would work? Builder? Factory?

Aucun commentaire:

Enregistrer un commentaire