samedi 18 novembre 2017

Combine two domain objects to a view

How would you combine two domain models in application design?

I got a domain model called Team, that includes: - id - name - description

And I got a domain model called TeamUser, that includes: - userId - teamId - roleType

The API consumer want a view that contains: - id (id of the team) - name - roleType

So this is a combination of data from the Team and TeamUser domain models, because the view contains roleType (and maybe more later).

How would I model this? And in which layer will this happen (service, repository, controller)? Because there is a difference in my database design and the actual presentation view.

Aucun commentaire:

Enregistrer un commentaire