As I understand, the Bounded Context can have modules, the modules can have many aggregate roots, the aggregate root can have entities. For the persistence, each aggregate root should have a repository.
With the numerous aggregate roots in a large project, is it okay to use a Generic Repository, one for ready only and one for update? Or should have separate repository for each aggregate root which can provide better control.
In a large complex project, I wouldn’t recommend using a generic repository since there will most likely be many specific cases beyond your basic
GetById(),GetAll()… operations.Greg Young has a great article on generic repositories : http://codebetter.com/gregyoung/2009/01/16/ddd-the-generic-repository/
Repositories generally don’t handle saving updates to your entities, i.e. they don’t have an
Update(EntityType entity)method. This is usually taken care of by your ORM’s change tracker/Unit of Work implementation. However, if you’re looking for an architecture that separates reads from writes, you should definitely have a look at CQRS.