Would flattening dtos be an approach that makes client code easier to write? Whats is the best practice here?
Would flattening dtos be an approach that makes client code easier to write? Whats
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The purpose of DTOs is to transfer data in a structured way. Inheritance tends to get in the way of that when trying to establish a data contract between client and server. You can do it, but it tends to be painful.
I recommend you go with aggregation instead.