<?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: Use reflection to compare the properties of two objects</title>
	<atom:link href="http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/</link>
	<description>Thoughts on life, liberty, and information technology</description>
	<lastBuildDate>Tue, 24 Jan 2012 10:43:34 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
	<item>
		<title>By: Rob</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-656029</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Fri, 10 Sep 2010 22:34:33 +0000</pubDate>
		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-656029</guid>
		<description>Thx. Very helpfull creating my unit tests.</description>
		<content:encoded><![CDATA[<p>Thx. Very helpfull creating my unit tests.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Abhishek Agrawal</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-648424</link>
		<dc:creator>Abhishek Agrawal</dc:creator>
		<pubDate>Thu, 26 Aug 2010 09:49:10 +0000</pubDate>
		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-648424</guid>
		<description>@Trevor - can you post the correct syntax for #3.</description>
		<content:encoded><![CDATA[<p>@Trevor &#8211; can you post the correct syntax for #3.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: flotschie</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-514679</link>
		<dc:creator>flotschie</dc:creator>
		<pubDate>Thu, 16 Jul 2009 13:16:36 +0000</pubDate>
		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-514679</guid>
		<description>Hi, I also think about using your code for tracking changes in business objects. 
It would be great if the return value is not only a integer, but provides the information which property(ies) (string name) is(are) different and the two different values of each property in a way that you have the complete information where the two objects differ from each other. :-)</description>
		<content:encoded><![CDATA[<p>Hi, I also think about using your code for tracking changes in business objects.<br />
It would be great if the return value is not only a integer, but provides the information which property(ies) (string name) is(are) different and the two different values of each property in a way that you have the complete information where the two objects differ from each other. <img src='http://www.sidesofmarch.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rob</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-499797</link>
		<dc:creator>Rob</dc:creator>
		<pubDate>Thu, 25 Jun 2009 02:07:47 +0000</pubDate>
		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-499797</guid>
		<description>Trevor, good point. The code is useless.</description>
		<content:encoded><![CDATA[<p>Trevor, good point. The code is useless.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-452944</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Sun, 05 Apr 2009 00:42:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-452944</guid>
		<description>I see this message box strips out the bracket characters.... perhaps that is what happened on step #3 which makes my post make no sense for line 3.</description>
		<content:encoded><![CDATA[<p>I see this message box strips out the bracket characters&#8230;. perhaps that is what happened on step #3 which makes my post make no sense for line 3.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Trevor</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-452941</link>
		<dc:creator>Trevor</dc:creator>
		<pubDate>Sun, 05 Apr 2009 00:39:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-452941</guid>
		<description>It is obvious that nobody has actually tried your code.

1) You have a lower case T in the ObjectHelper declaration (won&#039;t compile)
2) You are setting n2.Last before you instantiated the class (the first/last properties are mixed up).
3) You wrote ObjectHelper.Compare(n1, n2) and its a generic type... it needs to be: ObjectHelper.Compare(n1, n2).

4) It would be a lot more helpful if you demonstrated a base class that used such a technique such that every object that inherits from the class will automatically compare and equate by using all properties. Of course more than just Equals needs to be overridden, the operators too.
5) I am not sure why you are comparing fields, does it make sense to have classes that are not equal based on non-public field values? Anyone interacting with the object would be confused.</description>
		<content:encoded><![CDATA[<p>It is obvious that nobody has actually tried your code.</p>
<p>1) You have a lower case T in the ObjectHelper declaration (won&#8217;t compile)<br />
2) You are setting n2.Last before you instantiated the class (the first/last properties are mixed up).<br />
3) You wrote ObjectHelper.Compare(n1, n2) and its a generic type&#8230; it needs to be: ObjectHelper.Compare(n1, n2).</p>
<p>4) It would be a lot more helpful if you demonstrated a base class that used such a technique such that every object that inherits from the class will automatically compare and equate by using all properties. Of course more than just Equals needs to be overridden, the operators too.<br />
5) I am not sure why you are comparing fields, does it make sense to have classes that are not equal based on non-public field values? Anyone interacting with the object would be confused.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Swami</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-248194</link>
		<dc:creator>Swami</dc:creator>
		<pubDate>Wed, 09 Jul 2008 18:41:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-248194</guid>
		<description>If I have a property of type List, within the &quot;Name&quot; class, how could I compare values? Any idea?</description>
		<content:encoded><![CDATA[<p>If I have a property of type List, within the &#8220;Name&#8221; class, how could I compare values? Any idea?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kwame</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-132775</link>
		<dc:creator>Kwame</dc:creator>
		<pubDate>Wed, 26 Mar 2008 11:42:18 +0000</pubDate>
		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-132775</guid>
		<description>Great article! We are facing a similar task which involves implementing an audit trail that requires us to to record what data was changed. Like Brain mentioned we considered serializing the objects and looking for changes but I think a direct object comparison is definitely more elegant. Thanks for sharing.</description>
		<content:encoded><![CDATA[<p>Great article! We are facing a similar task which involves implementing an audit trail that requires us to to record what data was changed. Like Brain mentioned we considered serializing the objects and looking for changes but I think a direct object comparison is definitely more elegant. Thanks for sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: brian</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-46361</link>
		<dc:creator>brian</dc:creator>
		<pubDate>Thu, 27 Dec 2007 14:39:13 +0000</pubDate>
		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-46361</guid>
		<description>The code isn&#039;t really intended to compare everything (such as collection comparison, which could be very cumbersome). Perhaps a more &quot;generic&quot; way would be to get each property value&#039;s hash code and compare those -- that would, at least, eliminate the IComparable requirement, though it wouldn&#039;t be as precise.</description>
		<content:encoded><![CDATA[<p>The code isn&#8217;t really intended to compare everything (such as collection comparison, which could be very cumbersome). Perhaps a more &#8220;generic&#8221; way would be to get each property value&#8217;s hash code and compare those &#8212; that would, at least, eliminate the IComparable requirement, though it wouldn&#8217;t be as precise.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kiran Kumar Singani</title>
		<link>http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-46228</link>
		<dc:creator>Kiran Kumar Singani</dc:creator>
		<pubDate>Thu, 27 Dec 2007 10:31:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.sidesofmarch.com/index.php/archive/2007/08/03/use-reflection-to-compare-the-properties-of-two-objects/#comment-46228</guid>
		<description>Hi ,
You have done great job, but one thing i found in your code is , there is not handling for internal objects which are not 
t derived from the IComparable. Missing functionality for collection objects.
Regards,
Kiran Kumar Singani</description>
		<content:encoded><![CDATA[<p>Hi ,<br />
You have done great job, but one thing i found in your code is , there is not handling for internal objects which are not<br />
t derived from the IComparable. Missing functionality for collection objects.<br />
Regards,<br />
Kiran Kumar Singani</p>
]]></content:encoded>
	</item>
</channel>
</rss>

