jeudi 17 septembre 2020

Should i convert gRPC protobuf message to DTO? - Best Practice

Lately, I started using gRPC messages to interact with microservices. Until now I was using the REST API's with DTOs do keep on decoupling and encapsulation in the code itself.

Now I'm while using the gRPC protobuf msgs, I started wondering what shell be the best practice here - while thinking about it out loud I would say that when getting the message in the entry point of the application the best would be to convert it to DTO to keep on the decupling from gRPC protobuff messages and the code itself, from the other point of view - i'm just converting object to object and wondering if these overhead is mandatory / required

Looking forward to your thoughts around this one :)

Aucun commentaire:

Enregistrer un commentaire