mardi 12 avril 2016

Using one Repository Inside Another

I am new to DDD, I have a Partner aggregate which has an User reference. The User object itself is another Aggregate.

Since not all users has to be referenced in the Partner object, the User object is an aggregate root. The Partner is an aggregate root as well.

First: Would my design be wrong with one aggregate root inside another?

Second: If the design is right, would it be a bad practice to use one Repository inside another to persiste the Partner? (UserRepository inside PartnerRepository)

Obs: I am not using any ORM framework.

Aucun commentaire:

Enregistrer un commentaire