This document discusses different approaches for mapping objects to data transfer objects (DTOs) in domain-driven design (DDD) applications, including using EmitMapper, AutoMapper, and homegrown mapping methods. EmitMapper is fast but has low reliability, while AutoMapper is reliable but more object-oriented. Homegrown mapping depends on the implementation and can have high costs. The document also provides code samples for mapping between layers in DDD applications using these different mapping strategies.
4. ABSTRACTIONS AND MODEL
Модель представ-ляет собой специально
отобранный и сознательно упрощенный запас
знаний (набор данных)
Представленный в структу-рированной форме.
22. OTIS
Metadata
No DateTime and nullable value types support
Configuration file
Custom mapping
providers
23. AUTOMAPPER
Mapping Mapping
Through Through Test Mapping
Convention Configuration
Source/Destination Projection Validate
Properties Names Configuratio
Convention Type n
Converter
Value
Resolver
Ignore
27. MAPPERS SUMMARY TABLE
Style Facade Spee Open Reliabilit Silve Manuals Cost
/// d Sourc y rlight
e
Emit Procedura No The Yes Low Yes Poor Mid
Mapper l Best
Auto Object Yes Good Yes High Yes Good Low
Mapper Oriented
Home- Any Depends Depend Could Depends Yes Depends High
grown s be
Hinweis der Redaktion
DDD layers:PresentationApplicationServiceDomainDTOДостоинства:Спрятанные деталиРазглаживание серии связанных бизнес сущностейУменьшенное колличество вызовов на уровне данныхНедостаткиУвелечение колличества классов и соответсвенно затраты на кодированиеДополнительные вычисленя
When implementing code for transformation between the types, the required effort can make significant part of overall effort on project, thus making the project more expensive and/or delaying release date. Types which implement these transformations are usually called assemblers, and often consist of heaps of trivial code which has to be properly tested and maintained. The idea behind otis is that the assembler requirements should be expressed declaratively, and the library will take care of generating the assembler types.