Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Object-2-Object mapping, как приправа к вашему проекту

4,302 views

Published on

"Object-2-Object mapping, как приправа к вашему проекту" by Алик Духно

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Object-2-Object mapping, как приправа к вашему проекту

  1. 1. © O LEKSII DUKHNO @ LO HIKA SYST EMS
  2. 2. COMPLEXITY OF SOFTWARE
  3. 3. ABSTRACTIONS AND MODEL
  4. 4. ABSTRACTIONS AND MODELМодель представ-ляет собой специальноотобранный и сознательно упрощенный запасзнаний (набор данных)Представленный в структу-рированной форме.
  5. 5. DDD AS THE TOOL
  6. 6. DTO AND VIEW MODELDTO• Model data onlyView Model• Model data and behavioral aspects
  7. 7. WHY USING O-2-O WITH DDD? Layers are independent Code aligning Flattening logic encapsulation
  8. 8. RESULTS USING DDD WITH O-2-O ? Neater code Simpler support Better understanding
  9. 9. SAMPLES - DATA LAYER
  10. 10. SAMPLES – SERVICE LAYER
  11. 11. SAMPLES – APPLICATION LAYER
  12. 12. MODELS, DATA TRANSFER OBJECTS AND VIEW MODELS
  13. 13. HOME-GROWN OVER “OPERATOR” KEYWORDCode template:• public static implicit operator DTO_Type ( Entity_Type entity) Open sample
  14. 14. HOME-GROWN OVER EXTENSION METHODSCode template:• public static DTO_Type ToDTO ( this Entity_Type photo ) Open sample
  15. 15. HOME-GROWN OVER SEPARATE CLASSInstructions:• Define static or singleton class• Implement conversion methods explicitly Open sample
  16. 16. EMIT MAPPER KEY SUFFICIENCIESFast (close to hand written code)Supports monoPretty extensible
  17. 17. EMIT OBJECT MAPPERS
  18. 18. EMIT MAPPERS FACTORY
  19. 19. EMIT MAPPER CONFIGURATION
  20. 20. EMIT MAPPER Standard Custom converter Post processing Custom configurator
  21. 21. OTIS Metadata Configuration file Custom mapping providers
  22. 22. OTIS MetadataNo DateTime and nullable value types support Configuration file Custom mapping providers
  23. 23. AUTOMAPPER Mapping Mapping Through Through Test MappingConvention Configuration Source/Destination Projection Validate Properties Names Configuratio Convention Type n Converter Value Resolver Ignore
  24. 24. USING AUTOMAPPER IN THE ALLOCINE-CMS
  25. 25. USING AUTOMAPPER IN THE ALLOCINE-CMS
  26. 26. THE OTHERS OPTIONS Entities to DTOs T4 templates – To be continued
  27. 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 MidMapper l Best Auto Object Yes Good Yes High Yes Good LowMapper OrientedHome- Any Depends Depend Could Depends Yes Depends Highgrown s be

×