I am designing a distributed application, and to satisfy a single client request, I found myself making multiple calls to a remote interface, which increases the response time beyond acceptable levels. I found out a solution by using DTO (Data Transfer Object).
When designing a data transfer object, you have two primary choices: use a generic collection or create a custom object with explicit getter and setter methods.
A generic collection has the advantage that you only need a single class to fit any data transfer purpose throughout the whole application. The main drawback of using collection objects for DTOs is that the client has to access fields inside the collection either by position index (in the case of a simple array) or by element name (in the case of a keyed collection). Also, collections store items of the same type (usually the most generic Object type), which can lead to subtle but fatal coding errors that cannot be detected at compile time.
Better option would be going with a DTO class object. In Dotnet, it already provides you with a DTO object called Dataset. You can add DataTables, their relationships and transfer across various modules.