mercredi 31 juillet 2019

Aggregate Roots DDD/UoW/Repo/Service

I have some questions about the Aggregate Objects for Repositories.

I'm making an Rest Service with DDD/UoW/Repo and Service pattern. Our new cloud web-apps shall use this service. In order to do this we also have to sync data from the old databases, which are still in production. We created a "SyncService" which read and writes to/from the cloud and down to earth.

In my Rest/DDD-design. And i don't want the business logic to run on these, so in the original test project i have a repository for every model and the endpoints just does some simple validation and pushes the data straight to the database using the repository.

Let's say i have these entities:

  • Customer
  • Order
  • OrderLine
  • Article

Database Relationsships:

  • A customer can have many orders.

  • An Order can only have one customer.

  • An Order can have many OrderLine's.

  • An OrderLine can have one Article.

Questions:

  • Are all of these aggregates except Article?

  • And which of these Entities would have a repository?

  • What would the repository look like?

  • Should i make endpoints for the "SyncService" to only talk to generic repositories for insertion?

Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire