1 year ago

#63978

test-img

Ray

Use Entity in place of DTO inside reciever service

Basically i have this service A that sends a DTO to the service B.

What i did is the following:

1) B recieves the DTO from a.
2) B converts the DTO to an Entity
3) B uses the Entity (has an in-memory db).

I did this way because i deal with an extremely simple domain model, and i prefer to work with the whole entity rather then the DTO or a "reduced version" of the entity, for logical and integrity reasons.

Everything works, but someone asked me to "motivate" some cases in which this can be a good and feasible approach, even if it may not be suggested by the best practices, and to extend the aforementioned brief explanation.

I'm really stuck, can you give me some hints?

design-patterns

microservices

domain-driven-design

dto

0 Answers

Your Answer

Accepted video resources