开发者

How should I structure my repository classes?

I am new to DDD. I开发者_高级运维n my mini-project, I have a structure that looks like this (different from the actual names):

  • EntryClassificationGroup
  • EntryClassification
  • Entry
  • EntryType

Should I have just one repository class for all these 4 entities, since they are all related? Or should I have individual repositories for each one?


The question is can you add/delete/update EntryClassification or EntryClassificationGroup independently from your Entry and is it possible for them to exisit independently form your entries? If so it might be good idea have separate repository for it.

You might be concerned about querying data from your repositories here but Query object pattern allows you to query by different fields in the repository for Entry, let say by EntryType. So you may overcome this issue.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜