Simple Code
Simple Code

Reputation: 2574

Automappers vs Manual mapping during web development

I am working on a web application which implements DDD principles and using Asp.net web api and Entity Framework.

I know that my question is weird, but anyway I am looking for guidance from people who experienced that.

In the past I was doing mapping between dtos, domain models and data models, but recently I found it hard every time to do that.

Is it a reliable way to depend on built-in automappers to handle mapping for our applications, and what are the available built-in automappers to use them with web application as c# and Entity Framework?

Upvotes: 4

Views: 7064

Answers (1)

Amr Elgarhy
Amr Elgarhy

Reputation: 68922

I would say that using Automapper is quite useful, saves a lot of time and makes me focus more on the domain logic rather than mapping issues.

I have used http://automapper.org/ in many projects I have done and it is very powerful specially when understand how to configure the mappings the right way.

For sure there is a performance cost on using Automappers rather than manual mapping (in most of cases) but when considering the development time it saves, it worth a try.

There are many articles and questions talking in more details about this subject and comparisons with different mapping methods and tools: http://geekswithblogs.net/mrsteve/archive/2016/11/29/object-mapper-performance-comparison-revisited.aspx
Which is faster: Automapper, Valuinjector, or manual mapping? To what degree is each one faster?
https://softwareengineering.stackexchange.com/questions/167250/am-i-wrong-in-thinking-that-needing-something-like-automapper-is-an-indication-o
and much more, just google it...

Upvotes: 7

Related Questions