lundi 30 avril 2018

Reverse Decorator Pattern

I would like to dynamically add new product data to database. The users go through various list selections (where they can select an existing value or add new) to categorize a product and in the and add a price and size. The categorization order is as follows:

Category->Subcategory->Producer->Product

E.g. A user can choose an existing category and subcategory, but add a new product by a new producer. So the new data which should be added to DB will be product and producer data. If the ordering of selections would be reverse:

Product->Producer->Subcategory->Category

The base product would be set at the beginning and a normal Decorator Pattern would work, but in reverse order I don't see how.

Could someone tell me how would I do this the right way?

Aucun commentaire:

Enregistrer un commentaire