Thursday, August 13, 2009

Burden translating Entities to DTO

Well we finished a major sprint 2 months back and we were on a consolidation phase this sprint, solving browser issues, redesigning some pages, working on performance and also looking for some customer centric use-cases.

Ours is a n-tier Architected Enterprise Product which deals with wcf along with nHibernate. At that juncture I did give a lot of thought with one my junior that we end up wasting a lot of time translating Service Entities to our DTO.

I thought of writing a utility with the help of reflection which shall copy the members from one type to another. But then we dint took it up due to various reasons. Both the types should have same property name and type. In our scenario there are plenty of cases where in property names are similar but there are lot of properties which we made nullable in DTO's.

Last week Rick Strahl also wrote about it and it was good to read that there are more people who face similar problems. 3 years back we wrote a utility that shall browse 2 different entities and after maping properties manually used to generate the translaters that was the closest we got to solve the menace.

Am still in thinking mode...

No comments: