-
Notifications
You must be signed in to change notification settings - Fork 29
Object2ObjectMapper
Simple object to object mapper was product of my experiment where I tried to create mapper that is able to copy properties from one attribute to another. I had one object that came from O/R mapper and the other which was created by ASP.NET MVC binder. To avoid messing with state I was not able to replace existing object with the one that came from binder and so I decided to copy the matching properties. I found very soon way better solution to my problem but I still wanted to find out how good results I will get using different mapping methods.
There are three mapping methods
- Dynamic Code Mapper - generates dynamic code that copies properties from one object to another
- ReflectionBasedMapper - uses reflection to copy properties
- LcgMapper - used Lightweight Code Generation (LCG) to copy properties
You can read more about my experiment from following sources:
- Performance: Using dynamic code to copy property values of two objects
- Writing object to object mapper: first implementations
- Writing object to object mapper: moving to generics
- Writing object to object mapper: my mapper vs AutoMapper
There is one challence: is it possible to optimize LCG mapper to get way better performance or is there any other method that is able to beat it in speed?