<?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: Object Relational Mapping Sucks!</title>
	<atom:link href="http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/</link>
	<description>Enterprise Development Expert &#38; SOA Specialist</description>
	<lastBuildDate>Sat, 11 Feb 2012 15:16:10 -0600</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Mehdi</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-36102</link>
		<dc:creator>Mehdi</dc:creator>
		<pubDate>Thu, 16 Apr 2009 22:28:59 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-36102</guid>
		<description>Hi Udi,

Thanks for the response. 

Having the Q&#039;s data on the same OLTP database simplifies the solution a lot. I got it. Actually you answered my next question too ;o)

Thanks,
Mehdi</description>
		<content:encoded><![CDATA[<p>Hi Udi,</p>
<p>Thanks for the response. </p>
<p>Having the Q&#8217;s data on the same OLTP database simplifies the solution a lot. I got it. Actually you answered my next question too ;o)</p>
<p>Thanks,<br />
Mehdi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-36101</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Thu, 16 Apr 2009 20:52:19 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-36101</guid>
		<description>Mehdi,

Often the effort is much smaller than it may appear, as we are solving two smaller, more specific problems than one larger, more generic one.

There is also a gradient to how independent you keep the pieces. You could choose to implement Q of CQS over the same DB as the C part, thus having it automatically in sync. Just knowing that you can implement the Q part using different patterns often simplifies its code.

Hope that makes sense.</description>
		<content:encoded><![CDATA[<p>Mehdi,</p>
<p>Often the effort is much smaller than it may appear, as we are solving two smaller, more specific problems than one larger, more generic one.</p>
<p>There is also a gradient to how independent you keep the pieces. You could choose to implement Q of CQS over the same DB as the C part, thus having it automatically in sync. Just knowing that you can implement the Q part using different patterns often simplifies its code.</p>
<p>Hope that makes sense.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mehdi</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-36100</link>
		<dc:creator>Mehdi</dc:creator>
		<pubDate>Wed, 15 Apr 2009 22:48:48 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-36100</guid>
		<description>Hi Udi,

Thanks for the response. I had already read that excellent article, and your answer does help. 

I am just a bit concerned about the extra efforts involved. Please kindly correct me if I am wrong: 
If the query database in your CQS article gets implemented as an OLAP database, then it has to be always in sync with the OLTP database (well, with a few seconds delay); otherwise Queries (in CQS) and Reports will not show proper data. That means there will be two live databases (instead of one) to implement and maintain. That said, I think this model suits large scale enterprise applications which anyway need that kind of effort (right?!).

Thanks a lot for your helps.

Regards,
Mehdi</description>
		<content:encoded><![CDATA[<p>Hi Udi,</p>
<p>Thanks for the response. I had already read that excellent article, and your answer does help. </p>
<p>I am just a bit concerned about the extra efforts involved. Please kindly correct me if I am wrong:<br />
If the query database in your CQS article gets implemented as an OLAP database, then it has to be always in sync with the OLTP database (well, with a few seconds delay); otherwise Queries (in CQS) and Reports will not show proper data. That means there will be two live databases (instead of one) to implement and maintain. That said, I think this model suits large scale enterprise applications which anyway need that kind of effort (right?!).</p>
<p>Thanks a lot for your helps.</p>
<p>Regards,<br />
Mehdi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-36098</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Wed, 15 Apr 2009 08:04:17 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-36098</guid>
		<description>Mehdi,

Take a look at this post for some background:

http://www.udidahan.com/2008/08/11/command-query-separation-and-soa/

In short, when a our domain model performs the logic making a customer a gold customer, it publishes that fact. The reporting system takes that fact (the status of customer 7 is gold) and stores it as is, likely in a different (denormalized) schema than the one used under the domain model.

Does that help?</description>
		<content:encoded><![CDATA[<p>Mehdi,</p>
<p>Take a look at this post for some background:</p>
<p><a href="http://www.udidahan.com/2008/08/11/command-query-separation-and-soa/" rel="nofollow">http://www.udidahan.com/2008/08/11/command-query-separation-and-soa/</a></p>
<p>In short, when a our domain model performs the logic making a customer a gold customer, it publishes that fact. The reporting system takes that fact (the status of customer 7 is gold) and stores it as is, likely in a different (denormalized) schema than the one used under the domain model.</p>
<p>Does that help?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mehdi</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-36097</link>
		<dc:creator>Mehdi</dc:creator>
		<pubDate>Tue, 14 Apr 2009 23:56:53 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-36097</guid>
		<description>Hi Udi,

David asked a question above: &lt;i&gt;How do you generate reports based on data that depends on application/business logic (i.e. up in object world, above the ORM layer)?&lt;/i&gt;

I read your answer but it was not quite clear for me! For example, in a system where Gold Customer is defined by some specification over domain model, I am not quite sure how to create a report of Gold Customers without repeating this specification on my reporting server.

Regards,
Mehdi</description>
		<content:encoded><![CDATA[<p>Hi Udi,</p>
<p>David asked a question above: <i>How do you generate reports based on data that depends on application/business logic (i.e. up in object world, above the ORM layer)?</i></p>
<p>I read your answer but it was not quite clear for me! For example, in a system where Gold Customer is defined by some specification over domain model, I am not quite sure how to create a report of Gold Customers without repeating this specification on my reporting server.</p>
<p>Regards,<br />
Mehdi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mehdi</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-36074</link>
		<dc:creator>Mehdi</dc:creator>
		<pubDate>Thu, 12 Mar 2009 02:05:59 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-36074</guid>
		<description>Hi Udi,

Thanks for your response. I think I found a podcast of yours that talks about this. 

I do not know how I had missed your blog before. I (every architect/developer) should spend some time reading through it. You may see more questions from me; please kindly be patient with me.

Regards,
Mehdi</description>
		<content:encoded><![CDATA[<p>Hi Udi,</p>
<p>Thanks for your response. I think I found a podcast of yours that talks about this. </p>
<p>I do not know how I had missed your blog before. I (every architect/developer) should spend some time reading through it. You may see more questions from me; please kindly be patient with me.</p>
<p>Regards,<br />
Mehdi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-36072</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Wed, 11 Mar 2009 20:03:00 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-36072</guid>
		<description>Mehdi,

Glad you liked those articles. You may find some answers to your questions under my smart client and DDD categories:

http://www.udidahan.com/category/smart-client/

http://www.udidahan.com/category/ddd/

Let me know if you have any questions that aren&#039;t addressed by all that content :)</description>
		<content:encoded><![CDATA[<p>Mehdi,</p>
<p>Glad you liked those articles. You may find some answers to your questions under my smart client and DDD categories:</p>
<p><a href="http://www.udidahan.com/category/smart-client/" rel="nofollow">http://www.udidahan.com/category/smart-client/</a></p>
<p><a href="http://www.udidahan.com/category/ddd/" rel="nofollow">http://www.udidahan.com/category/ddd/</a></p>
<p>Let me know if you have any questions that aren&#8217;t addressed by all that content <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mehdi</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-36070</link>
		<dc:creator>Mehdi</dc:creator>
		<pubDate>Tue, 10 Mar 2009 00:45:29 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-36070</guid>
		<description>Hi Udi,
Great article. I have a question that is rather unrelated to this article (excuse my ignorance). I was reading your &#039;How to Select an Object-Relational Mapping Tool for .NET&#039; article yesterday, and surprisingly I finally found someone talking about an issue I have with ORMs. I hate using ORM auto generated objects all over my application, particularly in the client. In figure 5 of your article, you have business objects on the server which I beleive are different from ORM objects and then you have another set of business objects on the client! Would you please shed some light on this? Do I have to create two sets of business objects and map them together in business layer and then to ORM objects in repositories?
Thanks a lot for great articles.
Regards,
Mehdi</description>
		<content:encoded><![CDATA[<p>Hi Udi,<br />
Great article. I have a question that is rather unrelated to this article (excuse my ignorance). I was reading your &#8216;How to Select an Object-Relational Mapping Tool for .NET&#8217; article yesterday, and surprisingly I finally found someone talking about an issue I have with ORMs. I hate using ORM auto generated objects all over my application, particularly in the client. In figure 5 of your article, you have business objects on the server which I beleive are different from ORM objects and then you have another set of business objects on the client! Would you please shed some light on this? Do I have to create two sets of business objects and map them together in business layer and then to ORM objects in repositories?<br />
Thanks a lot for great articles.<br />
Regards,<br />
Mehdi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-35982</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Thu, 29 Jan 2009 22:46:20 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-35982</guid>
		<description>Alberto,

Nice idea with the @deprecated - I like it.
The interface is not only designed to prevent access to the setters but to all you to be explicit about the use case in which an object will be used. 

In other words, you could have multiple interfaces implemented by the same class where each calls out a specific use case.</description>
		<content:encoded><![CDATA[<p>Alberto,</p>
<p>Nice idea with the @deprecated &#8211; I like it.<br />
The interface is not only designed to prevent access to the setters but to all you to be explicit about the use case in which an object will be used. </p>
<p>In other words, you could have multiple interfaces implemented by the same class where each calls out a specific use case.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alberto Brandolini</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-35981</link>
		<dc:creator>Alberto Brandolini</dc:creator>
		<pubDate>Thu, 29 Jan 2009 08:21:29 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-35981</guid>
		<description>Hi Udi,

Nice post here. As a principle I tend to discourage the use of setters, but I do not always impose an interface on top, to prevent accessing the setters. However setters are meant to be used by frameworks, not by humans, so my trick is often to mark them as @deprecated (which is a reasonable trade-off solution in java).

If things get tougher, like in your answer to Colin, I couldn&#039;t agree more. Also on points 1 and 3, of course...

Best regards

Alberto</description>
		<content:encoded><![CDATA[<p>Hi Udi,</p>
<p>Nice post here. As a principle I tend to discourage the use of setters, but I do not always impose an interface on top, to prevent accessing the setters. However setters are meant to be used by frameworks, not by humans, so my trick is often to mark them as @deprecated (which is a reasonable trade-off solution in java).</p>
<p>If things get tougher, like in your answer to Colin, I couldn&#8217;t agree more. Also on points 1 and 3, of course&#8230;</p>
<p>Best regards</p>
<p>Alberto</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Object Relational Mapping Sucks - Hibernate Critical &#171; Akantos</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-30924</link>
		<dc:creator>Object Relational Mapping Sucks - Hibernate Critical &#171; Akantos</dc:creator>
		<pubDate>Thu, 04 Sep 2008 22:25:09 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-30924</guid>
		<description>[...] deny it for</description>
		<content:encoded><![CDATA[<p>[...] deny it for</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Jack</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-27733</link>
		<dc:creator>Colin Jack</dc:creator>
		<pubDate>Sat, 19 Jul 2008 21:45:51 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-27733</guid>
		<description>&quot;For instance, if we start correlating address to income brackets and make additional changes to the domain objects as a result of that change, or if we use that information for proximity calculations for preferred shipping partners.&quot;

Sorry get you now and yeah couldn&#039;t agree more. Definitely wouldn&#039;t trigger that sort of behavior from a property, I was just thinking of at most putting that address value object into the appropriate temporal collection.

If I did have that sort of behavior then absolutely I agree methods are the way to go, and if its cross aggregate maybe even a service.


&quot;Does that make sense?&quot;

As always it makes perfect sense and ta for replying.</description>
		<content:encoded><![CDATA[<p>&#8220;For instance, if we start correlating address to income brackets and make additional changes to the domain objects as a result of that change, or if we use that information for proximity calculations for preferred shipping partners.&#8221;</p>
<p>Sorry get you now and yeah couldn&#8217;t agree more. Definitely wouldn&#8217;t trigger that sort of behavior from a property, I was just thinking of at most putting that address value object into the appropriate temporal collection.</p>
<p>If I did have that sort of behavior then absolutely I agree methods are the way to go, and if its cross aggregate maybe even a service.</p>
<p>&#8220;Does that make sense?&#8221;</p>
<p>As always it makes perfect sense and ta for replying.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-27656</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Fri, 18 Jul 2008 20:48:31 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-27656</guid>
		<description>Colin,

It all depends on your domain, but I&#039;d say that as rules get added around that change of address that the setter becomes less suitable.

For instance, if we start correlating address to income brackets and make additional changes to the domain objects as a result of that change, or if we use that information for proximity calculations for preferred shipping partners.

Also, we need to understand that the ORM will be using that setter to fill the object with data, in which case we won&#039;t want to do all sorts of validation or business logic, leading us to map to private fields, a no-no in terms of maintainability.

So, while it may &quot;work&quot; in many cases, using a method is the preferred option. Keep in mind that putting a DTO/message on top of the method, while compatible, is not necessary.

Does that make sense?</description>
		<content:encoded><![CDATA[<p>Colin,</p>
<p>It all depends on your domain, but I&#8217;d say that as rules get added around that change of address that the setter becomes less suitable.</p>
<p>For instance, if we start correlating address to income brackets and make additional changes to the domain objects as a result of that change, or if we use that information for proximity calculations for preferred shipping partners.</p>
<p>Also, we need to understand that the ORM will be using that setter to fill the object with data, in which case we won&#8217;t want to do all sorts of validation or business logic, leading us to map to private fields, a no-no in terms of maintainability.</p>
<p>So, while it may &#8220;work&#8221; in many cases, using a method is the preferred option. Keep in mind that putting a DTO/message on top of the method, while compatible, is not necessary.</p>
<p>Does that make sense?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Colin Jack</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-27636</link>
		<dc:creator>Colin Jack</dc:creator>
		<pubDate>Fri, 18 Jul 2008 16:04:36 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-27636</guid>
		<description>Interesting stuff, I agree with 1/3 but not 100% sure on 2. 

On the change address without setters example, let&#039;s say Address is a value object and we do this:

customer.CurrentAddress = address;

Is this not an equally viable solution for many cases?  

Also I&#039;m not recommending any automatic binding to the domain or saying this is the right way to do things in all cases but equally I&#039;m just not sure that always creating a DTO/message and a method always makes sense.</description>
		<content:encoded><![CDATA[<p>Interesting stuff, I agree with 1/3 but not 100% sure on 2. </p>
<p>On the change address without setters example, let&#8217;s say Address is a value object and we do this:</p>
<p>customer.CurrentAddress = address;</p>
<p>Is this not an equally viable solution for many cases?  </p>
<p>Also I&#8217;m not recommending any automatic binding to the domain or saying this is the right way to do things in all cases but equally I&#8217;m just not sure that always creating a DTO/message and a method always makes sense.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sean Kearon</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-25997</link>
		<dc:creator>Sean Kearon</dc:creator>
		<pubDate>Tue, 01 Jul 2008 08:06:29 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-25997</guid>
		<description>Hi Udi

This approach is very interesting and I think the same as Ayende was recommending to me on the NHibernate users group.  Do you have a small example project where point 2 can be seen in action?

Thanks

Sean</description>
		<content:encoded><![CDATA[<p>Hi Udi</p>
<p>This approach is very interesting and I think the same as Ayende was recommending to me on the NHibernate users group.  Do you have a small example project where point 2 can be seen in action?</p>
<p>Thanks</p>
<p>Sean</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Domain Model Pattern</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-25951</link>
		<dc:creator>Domain Model Pattern</dc:creator>
		<pubDate>Mon, 30 Jun 2008 08:42:05 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-25951</guid>
		<description>[...] From some pointers about how to use (and not to use) these tools, see why object-relational mapping sucks. [...]</description>
		<content:encoded><![CDATA[<p>[...] From some pointers about how to use (and not to use) these tools, see why object-relational mapping sucks. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-25898</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Sun, 29 Jun 2008 11:10:45 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-25898</guid>
		<description>Alex,

&quot;Real-time visibility&quot; needs to be handled with some kind of publish/subscribe infrastructure otherwise users have to keep refreshing their screen. Object relational mapping makes no difference either way to that requirement.

Once multiple users / multiple event sources can update the same data, more powerful solutions are needed.</description>
		<content:encoded><![CDATA[<p>Alex,</p>
<p>&#8220;Real-time visibility&#8221; needs to be handled with some kind of publish/subscribe infrastructure otherwise users have to keep refreshing their screen. Object relational mapping makes no difference either way to that requirement.</p>
<p>Once multiple users / multiple event sources can update the same data, more powerful solutions are needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-25897</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Sun, 29 Jun 2008 11:08:08 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-25897</guid>
		<description>David,

Reporting is done by having your OLTP system publish events about things it has changed (using the domain model), and your reporting (OLAP) system subscribing to those events, and writing the data to whatever structure is most suitable for it.

The question was not at all ignorant.

Reporting is handled in such a way that it has no impact at all on the domain model.</description>
		<content:encoded><![CDATA[<p>David,</p>
<p>Reporting is done by having your OLTP system publish events about things it has changed (using the domain model), and your reporting (OLAP) system subscribing to those events, and writing the data to whatever structure is most suitable for it.</p>
<p>The question was not at all ignorant.</p>
<p>Reporting is handled in such a way that it has no impact at all on the domain model.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: udidahan</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-25895</link>
		<dc:creator>udidahan</dc:creator>
		<pubDate>Sun, 29 Jun 2008 10:58:09 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-25895</guid>
		<description>Bill,

That&#039;s correct - UI code doesn&#039;t use classes from the domain model for capturing data entered by the user. You may have a presentation model whose classes are designed for that. 

Messages are used to communicate the change. While messages are data transfer objects, they do not represent the entities so much as what needs to happen to those entities. Not Customer, Order, etc - rather ChangeCustomerAddress, CancelOrder, etc.

In that sense, you&#039;re not doing a &quot;vanilla update&quot; of the entities in the domain model, but calling domain-specific methods on them:

using (ISession session = GetSession())
using (ITransaction tx = session.BeginTransaction())
{
Address a = Convert.From&lt;AddressDTO&gt;.To&lt;Address&gt;(message.Address);
Customer c = session.Get&lt;Customer&gt;(message.CustomerId);

c.ChangeAddress(a);
tx.Commit();
}</description>
		<content:encoded><![CDATA[<p>Bill,</p>
<p>That&#8217;s correct &#8211; UI code doesn&#8217;t use classes from the domain model for capturing data entered by the user. You may have a presentation model whose classes are designed for that. </p>
<p>Messages are used to communicate the change. While messages are data transfer objects, they do not represent the entities so much as what needs to happen to those entities. Not Customer, Order, etc &#8211; rather ChangeCustomerAddress, CancelOrder, etc.</p>
<p>In that sense, you&#8217;re not doing a &#8220;vanilla update&#8221; of the entities in the domain model, but calling domain-specific methods on them:</p>
<p>using (ISession session = GetSession())<br />
using (ITransaction tx = session.BeginTransaction())<br />
{<br />
Address a = Convert.From&lt;AddressDTO&gt;.To&lt;Address&gt;(message.Address);<br />
Customer c = session.Get&lt;Customer&gt;(message.CustomerId);</p>
<p>c.ChangeAddress(a);<br />
tx.Commit();<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Alex Simkin</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-25799</link>
		<dc:creator>Alex Simkin</dc:creator>
		<pubDate>Thu, 26 Jun 2008 23:33:45 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-25799</guid>
		<description>Hi Udi,

How would you satisfy the requirement of the &quot;real-time visibility&quot; when requirement says: &quot;I want report that shows on-hand inventory at the moment when I pressed [Quantity on Hand] button&quot; ?</description>
		<content:encoded><![CDATA[<p>Hi Udi,</p>
<p>How would you satisfy the requirement of the &#8220;real-time visibility&#8221; when requirement says: &#8220;I want report that shows on-hand inventory at the moment when I pressed [Quantity on Hand] button&#8221; ?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-25761</link>
		<dc:creator>David</dc:creator>
		<pubDate>Wed, 25 Jun 2008 23:14:53 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-25761</guid>
		<description>Hi Udi,

Apologies in advance for the ignorant question :)...

How do you generate reports based on data that depends on application/business logic (i.e. up in object world, above the ORM layer)? Is it just a matter of pulling the relevant data from an app/service interface into a reporting DB?

Regards,
David</description>
		<content:encoded><![CDATA[<p>Hi Udi,</p>
<p>Apologies in advance for the ignorant question <img src='http://www.udidahan.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> &#8230;</p>
<p>How do you generate reports based on data that depends on application/business logic (i.e. up in object world, above the ORM layer)? Is it just a matter of pulling the relevant data from an app/service interface into a reporting DB?</p>
<p>Regards,<br />
David</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bill Pierce</title>
		<link>http://www.udidahan.com/2008/06/25/object-relational-mapping-sucks/comment-page-1/#comment-25741</link>
		<dc:creator>Bill Pierce</dc:creator>
		<pubDate>Wed, 25 Jun 2008 14:01:17 +0000</pubDate>
		<guid isPermaLink="false">http://udidahan.weblogs.us/2008/06/25/object-relational-mapping-sucks/#comment-25741</guid>
		<description>Can you expound on #2?  Does no setter mean I don&#039;t expose a domain object directly to a user?  I&#039;m used to setting properties on an object then doing something like session.Save(...).  Does no setter mean a user is exposed data via a DTO?, modifies the values it needs to, then passes that to a method that re-retrieves a domain object and ensures it hasn&#039;t changed since the user modified the DTO and updates it accordingly?</description>
		<content:encoded><![CDATA[<p>Can you expound on #2?  Does no setter mean I don&#8217;t expose a domain object directly to a user?  I&#8217;m used to setting properties on an object then doing something like session.Save(&#8230;).  Does no setter mean a user is exposed data via a DTO?, modifies the values it needs to, then passes that to a method that re-retrieves a domain object and ensures it hasn&#8217;t changed since the user modified the DTO and updates it accordingly?</p>
]]></content:encoded>
	</item>
</channel>
</rss>

