<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Futility: Transforming entities into DTOs</title>
	<atom:link href="http://jagregory.com/writings/futility-transforming-entities-into-dtos/feed/" rel="self" type="application/rss+xml" />
	<link>http://jagregory.com/writings/futility-transforming-entities-into-dtos/</link>
	<description>Monkeying with the code</description>
	<lastBuildDate>Fri, 26 Feb 2010 20:38:20 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: James Gregory</title>
		<link>http://jagregory.com/writings/futility-transforming-entities-into-dtos/comment-page-1/#comment-50938</link>
		<dc:creator>James Gregory</dc:creator>
		<pubDate>Tue, 16 Feb 2010 10:44:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jagregory.com/2008/05/06/futility-transforming-entities-into-dtos/#comment-50938</guid>
		<description>You should consider Jimmy Bogard&#039;s &lt;a href=&quot;http://www.codeplex.com/AutoMapper&quot; rel=&quot;nofollow&quot;&gt;AutoMapper&lt;/a&gt;.</description>
		<content:encoded><![CDATA[<p>You should consider Jimmy Bogard&#8217;s <a href="http://www.codeplex.com/AutoMapper" rel="nofollow">AutoMapper</a>.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Binoj Antony</title>
		<link>http://jagregory.com/writings/futility-transforming-entities-into-dtos/comment-page-1/#comment-50916</link>
		<dc:creator>Binoj Antony</dc:creator>
		<pubDate>Mon, 15 Feb 2010 06:32:24 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jagregory.com/2008/05/06/futility-transforming-entities-into-dtos/#comment-50916</guid>
		<description>I had faced this exact same problem earlier in my projects. I ended up creating a XmlDataMapper to solve this problem.

I have made this available on code plex at http://xmldatamapper.codeplex.com/

It uses simple Xml Files to do the mapping, hope this helps.</description>
		<content:encoded><![CDATA[<p>I had faced this exact same problem earlier in my projects. I ended up creating a XmlDataMapper to solve this problem.</p>
<p>I have made this available on code plex at <a href="http://xmldatamapper.codeplex.com/" rel="nofollow">http://xmldatamapper.codeplex.com/</a></p>
<p>It uses simple Xml Files to do the mapping, hope this helps.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lucas Goodwin</title>
		<link>http://jagregory.com/writings/futility-transforming-entities-into-dtos/comment-page-1/#comment-11613</link>
		<dc:creator>Lucas Goodwin</dc:creator>
		<pubDate>Thu, 02 Oct 2008 00:52:03 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jagregory.com/2008/05/06/futility-transforming-entities-into-dtos/#comment-11613</guid>
		<description>Essentially mapping is a form of the serialization problem.  As such you can solve it via explicit or implicit serialization.

I prefer implicit (reflection and convention) as the default behaviour with the option of explicit overrides (attributes as I hate programming in XML).

Realistically you should have a unit test that&#039;s checking your serializations in other areas so you should be covering this serialization with a unit test as well.  This coverage solves the refactoring requirements.</description>
		<content:encoded><![CDATA[<p>Essentially mapping is a form of the serialization problem.  As such you can solve it via explicit or implicit serialization.</p>
<p>I prefer implicit (reflection and convention) as the default behaviour with the option of explicit overrides (attributes as I hate programming in XML).</p>
<p>Realistically you should have a unit test that&#8217;s checking your serializations in other areas so you should be covering this serialization with a unit test as well.  This coverage solves the refactoring requirements.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Clément Bouillier</title>
		<link>http://jagregory.com/writings/futility-transforming-entities-into-dtos/comment-page-1/#comment-10477</link>
		<dc:creator>Clément Bouillier</dc:creator>
		<pubDate>Sat, 06 Sep 2008 09:42:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jagregory.com/2008/05/06/futility-transforming-entities-into-dtos/#comment-10477</guid>
		<description>Hi, 

I was also bored to write mapping code between object (what we can call Object/object mapping, and not object/relational mapping like NHibernate). But in fact it is very related issues.

I look at &quot;the other side&quot; (i.e. Java), and it exists a framework named Dozer.  It makes implicit mapping as you explain, but for more complicated mapping, you make the mapping in XML files like (N)Hibernate does.

I heard you thinking about your three requirements, but unfortunately, I think there is no solution that combine these three requirements, and the same problem exists with ORM.
Personaly, I prefer configuration over code generation (hence I prefer NHibernate or IBatis than generated DAO).
So, on the first requirement, configuration approach fails more or less, because in fact, you will unit test your classes that makes use of the mapper (and not make unit tests for string inspection, that have no value as you said).
On the second requirement, it is the one I prefer (because I am bored to write mapping code, and implicit mapping simplify it. There is a difference between mapping code and configuration complexity because in mapping code, you have to create object instances, to recurse on collections, to handle inheritance mapping (and that code is very boring), whereas with configuration, I just declare mapping between types and fields and I have implicit mapping.
On the third requirement, I think configuration is simpler than code, even if it needs to understand mapping framework. But it is another discussion...

Clément</description>
		<content:encoded><![CDATA[<p>Hi, </p>
<p>I was also bored to write mapping code between object (what we can call Object/object mapping, and not object/relational mapping like NHibernate). But in fact it is very related issues.</p>
<p>I look at &#8220;the other side&#8221; (i.e. Java), and it exists a framework named Dozer.  It makes implicit mapping as you explain, but for more complicated mapping, you make the mapping in XML files like (N)Hibernate does.</p>
<p>I heard you thinking about your three requirements, but unfortunately, I think there is no solution that combine these three requirements, and the same problem exists with ORM.<br />
Personaly, I prefer configuration over code generation (hence I prefer NHibernate or IBatis than generated DAO).<br />
So, on the first requirement, configuration approach fails more or less, because in fact, you will unit test your classes that makes use of the mapper (and not make unit tests for string inspection, that have no value as you said).<br />
On the second requirement, it is the one I prefer (because I am bored to write mapping code, and implicit mapping simplify it. There is a difference between mapping code and configuration complexity because in mapping code, you have to create object instances, to recurse on collections, to handle inheritance mapping (and that code is very boring), whereas with configuration, I just declare mapping between types and fields and I have implicit mapping.<br />
On the third requirement, I think configuration is simpler than code, even if it needs to understand mapping framework. But it is another discussion&#8230;</p>
<p>Clément</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: James Gregory</title>
		<link>http://jagregory.com/writings/futility-transforming-entities-into-dtos/comment-page-1/#comment-6908</link>
		<dc:creator>James Gregory</dc:creator>
		<pubDate>Wed, 14 May 2008 13:37:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jagregory.com/2008/05/06/futility-transforming-entities-into-dtos/#comment-6908</guid>
		<description>Thanks, that&#039;s very flattering.

This post has kind-of stemmed from using NHibernate. There are some situations where you can&#039;t pass the POCOs around (for example, Web-services) due to them being unserializable. I think you should be using DTOs in these situations anyway, but then you&#039;re back to the problem of mapping between them in an effortless way.</description>
		<content:encoded><![CDATA[<p>Thanks, that&#8217;s very flattering.</p>
<p>This post has kind-of stemmed from using NHibernate. There are some situations where you can&#8217;t pass the POCOs around (for example, Web-services) due to them being unserializable. I think you should be using DTOs in these situations anyway, but then you&#8217;re back to the problem of mapping between them in an effortless way.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel</title>
		<link>http://jagregory.com/writings/futility-transforming-entities-into-dtos/comment-page-1/#comment-6907</link>
		<dc:creator>Daniel</dc:creator>
		<pubDate>Wed, 14 May 2008 13:13:19 +0000</pubDate>
		<guid isPermaLink="false">http://blog.jagregory.com/2008/05/06/futility-transforming-entities-into-dtos/#comment-6907</guid>
		<description>Mappers have always bothered me too, and Iv tried to mess on with reflection, but it never seems flexiable enough. One way to tackle the problem is to use  kit like nHibernate so that you have POCOs  decoupled from your database schema  out of the box, that you can use up and down your application stack.

Good blog, by the way James, give is afew years and you will be a celebrity dev.</description>
		<content:encoded><![CDATA[<p>Mappers have always bothered me too, and Iv tried to mess on with reflection, but it never seems flexiable enough. One way to tackle the problem is to use  kit like nHibernate so that you have POCOs  decoupled from your database schema  out of the box, that you can use up and down your application stack.</p>
<p>Good blog, by the way James, give is afew years and you will be a celebrity dev.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
