I'm building an application which consist of a handfull of containerized micro services. These services expose APIs (typically in graphql) so data can be transferred around to/from the correct business services. These services also contain clients consuming the APIs of (some) the other services.

I find that I often have to repeat the implementation of the data types of data transfer objects (DTO) in the clients. And I often need to manually keep these implementations in sync - if the client need the new data exposed in the API.

I'm wondering whether it would be wise to put the DTOs inside a package (i.e. nuget - since all backend services is in dotnet core) that would be shared between service and client implementations?

0

There are 0 best solutions below