asp mvc list ecommerce product with dynamically changing specifications

二次信任 提交于 2019-12-02 10:16:29

问题


i am trying to develop product details page for eCommerce site, say we list some products in a view , now when users clicks in a product he is taken product details view to show product specifications, with add to cart, reviews etc , but here product specification changes dynamically for every product , example:

Clothing Product:

Size : 40

Mobile Product:

Operating System : Android

now i dont want the specification name operating system in a clothing product and vice versa.

so i researched about this and found this and this post's . But some folk's comment saying Entity Attribute Value is not good practice ,

so can anyone help me choose best and easy design pattern to list product details with changing specifications in asp mvc, i am new to this.

Any help would be great.


回答1:


EAV has several downsides:

  • The database layer can't force attribute names to be correct, so you have to do it in code
  • Search performance is slow if you're filtering on values in the EAV table
  • Performance is also slow if you try to join other tables based on the values in the EAV table

But if you need a flexible and dynamic set of attributes and you don't need to search or join by the attribute values, EAV is a good solution.



来源:https://stackoverflow.com/questions/31827767/asp-mvc-list-ecommerce-product-with-dynamically-changing-specifications

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!