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 Lesson
s make any sense without Topic
s? if not, then yes, this is very much like Order - OrderItem.
精彩评论