views:

61

answers:

1

I am new to DDD. In 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?

A: 

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.

Andrei Taptunov