Protobuff or DTO????
Posted by sruhvx@reddit | learnprogramming | View on Reddit | 4 comments
I just came across this protobuff, it's functionality soundd kinda like DTO (data transfer objects).So i was wondering if the protobuff eleminates the need for creating dto as protobuff does it for us????
archydragon@reddit
DTO is a concept which also doesn't really makes any sense outside of OOP.
Protobuf is a very specific data format.
These things are fundamentally different, why "or" is here.
sruhvx@reddit (OP)
yes right, but the thing is protobuff does the same thing that dto does, that is to validate the data structure as per the requirement. so should we just not make dto???
Dangerous-Quality-79@reddit
No. DTO is a concept, protobuf is an implemention. Protobuf is a type of DTO. Like JSON and XML, protobuf is an object that can be serialized and deserialized and constructed as needed.
Are you talking about a specific type of dto in a specific language and framework?
sruhvx@reddit (OP)
Yeah like I recently learned that you can validate the data in Auth flow using to, so i was learning tRPC with monotype, where i got to know about protobuff. Its sounded kinda like dto class, in both the thing we did a one common thing that was to create a data skeletal/structure in the flow