jargon

Design patterns·Modelling the domain

one class exists purely to turn the domain object into the response shape, and neither of them knows about the other.

Assembler

Also calledmapper object, DTO assembler, converter

A dedicated object that converts between a domain object and a data transfer object. Putting the conversion here rather than on either side is what keeps the model from knowing about the wire format and the DTO from knowing about the model. It is tedious code that mapping libraries promise to remove, at the cost of a rename in the model silently changing your API.

Commonly confused with