Mappers

A Mapper is a class that takes a control model and maps it into a DTO and vice versa. In other words, it creates a DTO based in the information contained in a model or component. When something needs to be sent to the client or need to synchronize data sent by client with back-end controls, the mapper process is invoked.

A mapper is composed by the following method:

  • Map: it takes a control model as input and creates a new DTO based on the information contained in each model, this process is triggered at the end of each WebMap Request and is used to send information from the server to the client.

  • ApplyChanges: it takes a DTO and syncs its value into a control model, this process is one of the first things that occur in WebMap request, and it get triggered when there is data coming from the client to the server.

  • Configure: sets the references need by an object in order to be rendered correctly, for example, a button control may have a Parent property that references to its container control (a window, a panel, a tab control, etc.), which also has a DTO for it, the referenced mechanism associates both DTOs. It could be triggered by both client and server synchronization.

Last updated