DTO: Data Transfer Objects

A Data Transfer Object (DTO) is a plain C# object used by WebMap to communicate the necessary data from between the different layers, typically the data sent in them is the following:

  • Visual properties needed to render a control component and dictated its behavior in the UI. Properties such as Visible, Enabled, BackColor, among many others.

  • Event handler’s information, similar to what can be found in a desktop control the WebMAp controls implement the required events that need to be bound in order to be able to execute any action, a DTO has the responsibility of indicating which are the events that are needed set.

  • Object references, a DTO is a plain object design to hold only value types (string, Boolean, numeric, dates, etc.), however, the objects that they represent may have references to other complex objects, such as a Parent control, that need to be sent as well in other to represent objects hierarchy.

A DTO class does not have any kind methods, they serve as a contract between the server and the client layers. If a model property needs to be sent to the front-end it must necessarily be included in the DTO specification.

Last updated