I have to implement a shopping cart where i can add an item and on top of it add some accessories for example TV is an item and HDMI cable as its accessory.
I can also add or remove the accessories as and when wanted . Which design pattern i should consider for this?
I thought of decorator for adding accessories on top of item.But in decorator once i added i cannot remove an element.
Aucun commentaire:
Enregistrer un commentaire