Answer the question
In order to leave comments, you need to log in
Different DTOs for creating/getting objects VS one DTO but forbid null serialization?
I'm just learning, making the first programs, and I get several DTO classes for creating and receiving objects (obviously less information is needed to create).
I thought that we could do it a little differently:
One DTO, create a separate constructor for creating objects in it. Unique fields that are only used on creation are not initialized on getting the object. And in the serialization settings, disable the serialization of null objects. But would this be good practice? Or will it be a shameful crutch, which will be ashamed to send to someone?
I really appreciate your answers! Also I ask a question only because it is weak in good/bad practices
PS whether transfer of object with some superfluous null fields affects optimization?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question