Eyris
How to best manage DTOs in Clean arch DDD project
It's a very large application with lots of different modules/domains. The legacy part is build on a n-tier architecture/clean ish hybrid but it has degraded over the years. We have looked at full out vertical slice arch but decided against it. Clean arch was chosen partially cause we are used to it and in order to improve testability and some other factors. And we hade trouble mapping some of the current flows to a vertical slice type of approach. This may just be due to lack of expertise in the area though.
DDD we want to implement to decouple some parts that have grown together to much and will help our future selfs maintain a more decoupled code base.
15 replies
How to best manage DTOs in Clean arch DDD project
It is for returning the data to the API endpoint and then the user. It does not return the DomainObject Article since it is from an external index. But it has knowledge of the domain object via ID. So since it really has very little to do with the domain layer im unsure of where I should put it. Is going straight to infra layer the better way?
15 replies
How to best manage DTOs in Clean arch DDD project
It is very similar right now at least. For example a use case like "SubmitOrder" will have a API endpoint "SubmitOrderEndpoint" which calls the SubmitOrderCommand via mediatr. Then it enters domain layer. Ofc there could be multiple commandhandlers that listen to submitorder events in application layer I guess.
15 replies