开发者

DDD Topic - Lesson association AggregateRoot

开发者 https://www.devze.com 2023-02-08 16:51 出处:网络
I\'m new in DDD. I 开发者_StackOverflow社区have a Topic entity and Lesson entity. Topic has many Lessons.

I'm new in DDD. I 开发者_StackOverflow社区have a Topic entity and Lesson entity. Topic has many Lessons. I need to add/remove Topics as well as Lessons. Should i create two different repositories for entities, or just one TopicRepository which handles all the lessons? Is this a classic Order - OrderItem model?

Thanks


If both entites makes sense without eachother, then go for the two different repositories.

If you delete a topic, should you then delete all lessons associated with this topic? If, yes .. then You got yourself a TopicRepository handling both topics and lessons.

If no, you have two repositories.


Do Lessons make any sense without Topics? if not, then yes, this is very much like Order - OrderItem.

0

精彩评论

暂无评论...
验证码 换一张
取 消