关于实体的聚合问题
我有两个实体 Publisher 和 ReferralOffer。优惠仅在一段时间内(例如 2 个月)有效。引入另一个人作为推荐人的发布商将获得该报价所述的资金。一个发布商可以为某一特定报价带来尽可能多的人。一段时间后,该优惠到期并生成新的优惠。
1 )现在的问题是 Publisher 是我的根聚合,但 refferaloffer 是 Publisher 聚合的一部分。或 refferaloffer 是单独汇总的。
2) refferaloffer 是否是价值对象。
3)我如何创建可以维护 refferedTo 和 refeeredBy 的类。
I have two entities Publisher and ReferralOffer. An offer is active for only period of time say 2 months. Publisher who bring another person as Refferal gets money which described for that offer. One publisher can bring as many person as he can for a particular offer. After some period that offer expires and new one is generated.
1 ) Now the question is Publisher is my root aggregate, but is refferaloffer is part of Publisher aggregate. or refferaloffer is separate aggregate.
2) Is refferaloffer is value object.
3) how do i create class where refferedTo And refeeredBy can be maintain.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我阅读了有关推荐营销的wiki 文章,但这还不足以让我了解您的业务。
将尝试在代码中反映一些想法。
请记住 - 我对业务领域知之甚少。
省略/忽略大量细节(例如,可能出现的技术困难,甚至是与领域相关的事情,例如当推荐成为发布商时)。
但希望 - 这可能会给你一些想法。
请记住 - 该代码只是为了帮助您。情况远非如此。
尝试彻底理解代码并了解每行代码的含义。
PS一如既往地欢迎批评
I read wiki article about referral marketing, but that's not enough for me to understand Your business.
Will try to reflect some ideas in code.
Keep in mind - I have little knowledge of business domain.
Omitting/ignoring huge amount of details (e.g. technical difficulties that might arise or even domain related things like when referral becomes a publisher).
But hopefully - that might give You some ideas.
Keep in mind - this code is just to assist You. It's far from good.
Try to understand code thoroughly and see implications every line of code makes.
P.s. criticism is welcome as usual