What architecture can I use to handle a shopping cart where each product requries different attributes to be saved

后端 未结 4 2056
星月不相逢
星月不相逢 2021-02-06 15:25

I am building an application that is very similar to a shopping cart. The user selects a product from a list, and then based on that product, a few properties need to be set an

4条回答
  •  故里飘歌
    2021-02-06 16:02

    Since you're looking into an elegant solution, you may want to take a look at the Adaptive Object-Model Architectural style. You can search here, or here. Basically your problem can be solved by simply using the TypeSquare pattern, with maybe the Interpreter pattern for the business rules (if it ever gets that complex).

提交回复
热议问题