Are JSON objects and DTO (data transfer objects) the same thing, or are they completely different? In the case of a REST architecture, the incoming HTTP requests can be be sent as JSON from the client, then serialized to CLR objects once they are received on server end.
In this particular case, would the JSON be considered the DTO, or would the serialized object be refereed to as the DTO?
I'm very new to data transfer between multiple systems, so I appreciate the help.
A DTO is simply a design pattern for representation of data and can be formatted as JSON, XML or even something else.
JSON is the type of serialization. DTO is the serialized object.
Aside: JSON does more than just data-transfer, but I don't think that detail is important in the context of your question. What is important is that if you use the behavioural aspects of JSON, you are no longer dealing with a DTO as a DTO should be behaviour-less.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With