<?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 for Coding out of procrastination</title>
	<atom:link href="http://www.mattfreeman.co.uk/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mattfreeman.co.uk</link>
	<description>A developer's rants and light bulb moments!</description>
	<pubDate>Wed, 10 Mar 2010 23:09:23 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on NHibernate - Opinionated Style by mattcodes</title>
		<link>http://www.mattfreeman.co.uk/2009/01/nhibernate-opinionated-software/comment-page-1/#comment-14</link>
		<dc:creator>mattcodes</dc:creator>
		<pubDate>Tue, 10 Feb 2009 20:56:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattfreeman.co.uk/2009/01/nhibernate-opinionated-software/#comment-14</guid>
		<description>@q: Thanks for sharing. It's handy to know that the Linq extension for Count will shortcut where it can, nice!

@Chris: Where different uses of the domain model require a variation in rules or where the rules are not stable then I somewhat agree that embebbing the rules may make make such undesireable.  However for rules that are always applicable then these should exists in the domain model, your domain model should rich rather than weak. You could have both embedded and flexible rules, how they are injected is outside scope of this topic. 

With regards to immediate validation, I disagree that you must surround every operation with exception catching, I'll illustrate the technique and more importantly the concepts in a blog post forthcoming if you can hand on a few days.</description>
		<content:encoded><![CDATA[<p>@q: Thanks for sharing. It&#8217;s handy to know that the Linq extension for Count will shortcut where it can, nice!</p>
<p>@Chris: Where different uses of the domain model require a variation in rules or where the rules are not stable then I somewhat agree that embebbing the rules may make make such undesireable.  However for rules that are always applicable then these should exists in the domain model, your domain model should rich rather than weak. You could have both embedded and flexible rules, how they are injected is outside scope of this topic. </p>
<p>With regards to immediate validation, I disagree that you must surround every operation with exception catching, I&#8217;ll illustrate the technique and more importantly the concepts in a blog post forthcoming if you can hand on a few days.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on NHibernate - Opinionated Style by Chris Marisic</title>
		<link>http://www.mattfreeman.co.uk/2009/01/nhibernate-opinionated-software/comment-page-1/#comment-11</link>
		<dc:creator>Chris Marisic</dc:creator>
		<pubDate>Tue, 03 Feb 2009 17:08:59 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattfreeman.co.uk/2009/01/nhibernate-opinionated-software/#comment-11</guid>
		<description>I am one of the people that full disagrees with #4. Validation should be regulated into it's own services, combining it with your domain objects make your code hard to test, spreads out the validation logic, makes complex validation nearly impossible and just leads to poor and unmaintainable business code.

Business code should not be inside the domain layer!

Now I do have some wiggle room on that and if you have simple validations such as Age must be &#62; 0, or regular expression validators that make sure this string field for zip code really is a zip code, I can accept that in a domain layer.

I still think it's bad practice to throw exceptions from properties in any situation though because then every single operation you ever do with your object you MUST surround it with try/catch, which isn't really acceptable in my opinion which is why it makes sense to not combine domain objects + validation. But if you must atleast take advantage of enterprise library's validation classes and do screening on Validation.Validate(object) instead of throwing random exceptions from setters.</description>
		<content:encoded><![CDATA[<p>I am one of the people that full disagrees with #4. Validation should be regulated into it&#8217;s own services, combining it with your domain objects make your code hard to test, spreads out the validation logic, makes complex validation nearly impossible and just leads to poor and unmaintainable business code.</p>
<p>Business code should not be inside the domain layer!</p>
<p>Now I do have some wiggle room on that and if you have simple validations such as Age must be &gt; 0, or regular expression validators that make sure this string field for zip code really is a zip code, I can accept that in a domain layer.</p>
<p>I still think it&#8217;s bad practice to throw exceptions from properties in any situation though because then every single operation you ever do with your object you MUST surround it with try/catch, which isn&#8217;t really acceptable in my opinion which is why it makes sense to not combine domain objects + validation. But if you must atleast take advantage of enterprise library&#8217;s validation classes and do screening on Validation.Validate(object) instead of throwing random exceptions from setters.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on NHibernate - Opinionated Style by q</title>
		<link>http://www.mattfreeman.co.uk/2009/01/nhibernate-opinionated-software/comment-page-1/#comment-10</link>
		<dc:creator>q</dc:creator>
		<pubDate>Tue, 03 Feb 2009 14:07:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattfreeman.co.uk/2009/01/nhibernate-opinionated-software/#comment-10</guid>
		<description>"...available via Linq extensions method of Count() - perhaps not as efficient but I’m willing to make this tiny sacrifice..."

Enumerable.Count extension method actually has a shortcut for ICollection interface - it just returns Count property without iterating the collection.</description>
		<content:encoded><![CDATA[<p>&#8220;&#8230;available via Linq extensions method of Count() - perhaps not as efficient but I’m willing to make this tiny sacrifice&#8230;&#8221;</p>
<p>Enumerable.Count extension method actually has a shortcut for ICollection interface - it just returns Count property without iterating the collection.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on NHibernate - Opinionated Style by Reflective Perspective - Chris Alcock &#187; The Morning Brew #278</title>
		<link>http://www.mattfreeman.co.uk/2009/01/nhibernate-opinionated-software/comment-page-1/#comment-9</link>
		<dc:creator>Reflective Perspective - Chris Alcock &#187; The Morning Brew #278</dc:creator>
		<pubDate>Tue, 03 Feb 2009 08:16:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattfreeman.co.uk/2009/01/nhibernate-opinionated-software/#comment-9</guid>
		<description>[...] NHibernate - Opinionated Style - Matt Freeman looks at some of the enforce style that NHibernate brings to your code, and talks about how you can make these conventions nicer. [...]</description>
		<content:encoded><![CDATA[<p>[...] NHibernate - Opinionated Style - Matt Freeman looks at some of the enforce style that NHibernate brings to your code, and talks about how you can make these conventions nicer. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on NHibernate - Opinionated Style by DotNetShoutout</title>
		<link>http://www.mattfreeman.co.uk/2009/01/nhibernate-opinionated-software/comment-page-1/#comment-8</link>
		<dc:creator>DotNetShoutout</dc:creator>
		<pubDate>Mon, 02 Feb 2009 12:42:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.mattfreeman.co.uk/2009/01/nhibernate-opinionated-software/#comment-8</guid>
		<description>&lt;strong&gt;NHibernate - Opinionated Style &#124; Matt Freeman's Coding Blog...&lt;/strong&gt;

Thank you for submitting this cool story - Trackback from DotNetShoutout...</description>
		<content:encoded><![CDATA[<p><strong>NHibernate - Opinionated Style | Matt Freeman&#8217;s Coding Blog&#8230;</strong></p>
<p>Thank you for submitting this cool story - Trackback from DotNetShoutout&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on NHibernate 2.1 Trunk - Entity-Name, Some Inheritance and Dynamic Component by Your Reader</title>
		<link>http://www.mattfreeman.co.uk/2009/01/nhibernate-21-trunk-entity-name-some-inheritance-and-dynamic-component/comment-page-1/#comment-6</link>
		<dc:creator>Your Reader</dc:creator>
		<pubDate>Wed, 28 Jan 2009 00:14:28 +0000</pubDate>
		<guid isPermaLink="false">http://www2.mattfreeman.co.uk/?p=8#comment-6</guid>
		<description>Good work! Thank you!
I always wanted to write in my site something like that. Can I take part of your post to my blog? 
Of course, I will add backlink?

Sincerely, Reader</description>
		<content:encoded><![CDATA[<p>Good work! Thank you!<br />
I always wanted to write in my site something like that. Can I take part of your post to my blog?<br />
Of course, I will add backlink?</p>
<p>Sincerely, Reader</p>
]]></content:encoded>
	</item>
</channel>
</rss>
