关于品类产品关系模型的建议
我正在努力让自己的思想集中在我的大学的一个项目上,但我似乎做不到。我的模型无法满足我的要求。也许在商店工作过的人可以帮助我。
假设我们有过度使用的电子商务模式。
类别有很多产品(我一直不明白 SKU 在这里的位置) 前任: T 恤 -> 2010年夏季 新年快乐
根据我们所处理的产品类型,
产品可以有多种规格。所以产品有很多规格,有很多规格项目。 前任: 2010 年夏季 P 白色 Summer 2010 XXX Green
编辑:或者这可以称为变体,也许是一个更好的名字。
等等..实际上每一个都是一个SKU,对吗?其中有库存数量、价格、重量等。
我如何解决这些关系?
谢谢! 蜥蜴
I'm trying to get my mind going on a project to my college, but I can't seem to get it right. I'm can't fit my requirements in my models. Maybe someone that has worked on a store can help me out.
Let's say we have our so overused e-commerce model.
Category has many Products (I never understood where the SKU fits in here)
Ex:
T-Shirts -> Summer 2010
Happy New Year
Products can have many specifications based on what kind of product we are dealing with.
So Product has many specification that has many specification_items.
Ex:
Summer 2010 P White
Summer 2010 XXX Green
Edit: Or this can be called variantions, maybe its a better name.
Etc.. each of that is in fact a SKU, right? which has a stock quantity, price, weight etc.
How do I work this relationships out?
Thanks!
LiZarD
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我和第一个评论者有同样的问题,但是我会尝试将您的描述翻译成 UML 术语(有分配给这个问题的对象建模标签)。
类别是与产品类具有一对多关联的类。产品类可能包括您在 SKU 中提到的所有属性,或者如果需要的话,可以从单独的 SKU 类继承它们,甚至实现 SKU 接口。比产品类别和规格类别之间具有一对一的关联。规范类将由Specification_item 类实例组成。
这几乎涵盖了您所描述的内容。
I have the same problem as the first commenter, however i'll try to translate your description into UML terms(there is object modeling tag assigned to this question).
Category is a class with one to many associatio towards Product class. Product class may include all the attributes you mentioned in SKU or maybe, if needed inherit them from separate SKU class or even realize SKU interface. Than you have one to one association between Product class and Specification class. Specification class will be composed of Specification_item class instances.
This pretty much covers what you have described.