1. If you use the convention-based mapping and a property is later renamed that becomes a runtime error and a common source of annoying bugs. 2. If you don't use convention-based mapping (ie you explicitly map each property) then you are just using automapper to do your projection, which is unnecessary complexity.
AutoMapper is used whenever there are many data properties for objects, and we need to map them between the object of source class to the object of destination class, Along with the knowledge of data structure and algorithms, a developer is required to have excellent development skills as well.
Inside this article, it discusses performance and it indicates that Automapper is 7 times slower than manual mapping. This test was done on 100,000 records and I must say I was shocked.
Checkout the Dozer project.
Dozer supports simple property mapping, complex type mapping, bi-directional mapping, implicit-explicit mapping, as well as recursive mapping.
It makes use of BeanUtils and extends on it.
Check out ModelMapper. It was inspired by AutoMapper, but adds a few new things such as intelligent mapping.
ModelMapper is an intelligent object mapping framework that eliminates the need to manually map objects to each other. It uses a convention-based approach to map objects while providing a simple refactoring safe API for handling specific mapping scenarios.
http://modelmapper.org
Also a brief blog post from Jimmy Bogard, the creator of AutoMapper:
http://lostechies.com/jimmybogard/2012/09/17/automapper-for-java/
You should check the open source project Beanutils from Apache Commons.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With