<?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: Collecting Errors</title>
	<atom:link href="http://lostechies.com/mokhan/2008/10/28/collecting-errors/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/mokhan/2008/10/28/collecting-errors/</link>
	<description>Just another LosTechies site</description>
	<lastBuildDate>Tue, 12 May 2009 07:06:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Maxim Tihobrazov</title>
		<link>http://lostechies.com/mokhan/2008/10/28/collecting-errors/#comment-33</link>
		<dc:creator>Maxim Tihobrazov</dc:creator>
		<pubDate>Tue, 11 Nov 2008 15:44:19 +0000</pubDate>
		<guid isPermaLink="false">/blogs/mokhan/archive/2008/10/28/collecting-errors.aspx#comment-33</guid>
		<description>Probably you mean this one:

http://ayende.com/Blog/archive/2007/10/21/The-IoC-mind-set-Validation.aspx

But there are situations when it is better to show a field-level error when a database error occurs</description>
		<content:encoded><![CDATA[<p>Probably you mean this one:</p>
<p><a href="http://ayende.com/Blog/archive/2007/10/21/The-IoC-mind-set-Validation.aspx" rel="nofollow">http://ayende.com/Blog/archive/2007/10/21/The-IoC-mind-set-Validation.aspx</a></p>
<p>But there are situations when it is better to show a field-level error when a database error occurs</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jcteague</title>
		<link>http://lostechies.com/mokhan/2008/10/28/collecting-errors/#comment-32</link>
		<dc:creator>jcteague</dc:creator>
		<pubDate>Mon, 03 Nov 2008 03:01:13 +0000</pubDate>
		<guid isPermaLink="false">/blogs/mokhan/archive/2008/10/28/collecting-errors.aspx#comment-32</guid>
		<description>@Maxim, I disagree.  If you have a lot of logic surounding your domain classes, that logic should be contained withing a factory class.  You can still use the same message collection pattern for those scenarios.

As far as database errors goes, the user does not care about those.  There is nothing user can do.  In that case a system error should be displayed, through UI general error handling system.

We were talking at Kaizenconf about advanced uses of IOC containers and vailidation came up.  Ayende has an old blog entry about it, sorry I don&#039;t have the link handy, but you might want to search for it.</description>
		<content:encoded><![CDATA[<p>@Maxim, I disagree.  If you have a lot of logic surounding your domain classes, that logic should be contained withing a factory class.  You can still use the same message collection pattern for those scenarios.</p>
<p>As far as database errors goes, the user does not care about those.  There is nothing user can do.  In that case a system error should be displayed, through UI general error handling system.</p>
<p>We were talking at Kaizenconf about advanced uses of IOC containers and vailidation came up.  Ayende has an old blog entry about it, sorry I don&#8217;t have the link handy, but you might want to search for it.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mo</title>
		<link>http://lostechies.com/mokhan/2008/10/28/collecting-errors/#comment-31</link>
		<dc:creator>Mo</dc:creator>
		<pubDate>Fri, 31 Oct 2008 18:26:36 +0000</pubDate>
		<guid isPermaLink="false">/blogs/mokhan/archive/2008/10/28/collecting-errors.aspx#comment-31</guid>
		<description>Thanks Victor for clarifying that for me.

I like what Michael posted in the comments at http://mokhan.ca/blog/CommentView,guid,36584ca0-a20f-4df4-acdc-c844d15c0b2f.aspx#commentstart

He suggested a fluent interface for validation... 

CreateRule.For&lt;IUser&gt;()
.Property(u =&gt; u.FirstName)
.WithRule((u, value) =&gt; !value.IsNullOrEmpty())
.WithError(&quot;First name is required&quot;);

This would allow me to validate a DTO instead of a domain object, for messages to return to the UI, and that would allow me to ensure the domain does not enter an invalid state. So user.change_first_name_to(first_name); would throw if it was invalid. However, this might violate DRY.

@Maxim
As far the database validation goes, I suppose if we were to ensure that our domain object do not enter an invalid state that would reduce our chances for allowing bad data into the db. Our layers of protection, would be js validation in the ui, plus dto validation in service, and throw exception from the domain if it gets that far.

I think I&#039;m ranting... but perhaps this suggests that I could use some more guidance in &quot;validation&quot;, or at least a working example!</description>
		<content:encoded><![CDATA[<p>Thanks Victor for clarifying that for me.</p>
<p>I like what Michael posted in the comments at <a href="http://mokhan.ca/blog/CommentView,guid,36584ca0-a20f-4df4-acdc-c844d15c0b2f.aspx#commentstart" rel="nofollow">http://mokhan.ca/blog/CommentView,guid,36584ca0-a20f-4df4-acdc-c844d15c0b2f.aspx#commentstart</a></p>
<p>He suggested a fluent interface for validation&#8230; </p>
<p>CreateRule.For<iuser>()<br />
.Property(u => u.FirstName)<br />
.WithRule((u, value) => !value.IsNullOrEmpty())<br />
.WithError(&#8220;First name is required&#8221;);</p>
<p>This would allow me to validate a DTO instead of a domain object, for messages to return to the UI, and that would allow me to ensure the domain does not enter an invalid state. So user.change_first_name_to(first_name); would throw if it was invalid. However, this might violate DRY.</p>
<p>@Maxim<br />
As far the database validation goes, I suppose if we were to ensure that our domain object do not enter an invalid state that would reduce our chances for allowing bad data into the db. Our layers of protection, would be js validation in the ui, plus dto validation in service, and throw exception from the domain if it gets that far.</p>
<p>I think I&#8217;m ranting&#8230; but perhaps this suggests that I could use some more guidance in &#8220;validation&#8221;, or at least a working example!</iuser></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Victor Kornov</title>
		<link>http://lostechies.com/mokhan/2008/10/28/collecting-errors/#comment-30</link>
		<dc:creator>Victor Kornov</dc:creator>
		<pubDate>Wed, 29 Oct 2008 17:21:24 +0000</pubDate>
		<guid isPermaLink="false">/blogs/mokhan/archive/2008/10/28/collecting-errors.aspx#comment-30</guid>
		<description>@ Thomas:
it&#039;s one person having 2 blogs &amp; crossposting.</description>
		<content:encoded><![CDATA[<p>@ Thomas:<br />
it&#8217;s one person having 2 blogs &#038; crossposting.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Thomas</title>
		<link>http://lostechies.com/mokhan/2008/10/28/collecting-errors/#comment-29</link>
		<dc:creator>Thomas</dc:creator>
		<pubDate>Wed, 29 Oct 2008 14:59:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/mokhan/archive/2008/10/28/collecting-errors.aspx#comment-29</guid>
		<description>stolen article from 
http://mokhan.ca/blog/CommentView,guid,36584CA0-A20F-4DF4-ACDC-C844D15C0B2F.aspx#a7cf4b2f-9631-413a-b437-219f770648fe
?

</description>
		<content:encoded><![CDATA[<p>stolen article from<br />
<a href="http://mokhan.ca/blog/CommentView,guid,36584CA0-A20F-4DF4-ACDC-C844D15C0B2F.aspx#a7cf4b2f-9631-413a-b437-219f770648fe" rel="nofollow">http://mokhan.ca/blog/CommentView,guid,36584CA0-A20F-4DF4-ACDC-C844D15C0B2F.aspx#a7cf4b2f-9631-413a-b437-219f770648fe</a><br />
?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Victor Kornov</title>
		<link>http://lostechies.com/mokhan/2008/10/28/collecting-errors/#comment-28</link>
		<dc:creator>Victor Kornov</dc:creator>
		<pubDate>Wed, 29 Oct 2008 12:02:41 +0000</pubDate>
		<guid isPermaLink="false">/blogs/mokhan/archive/2008/10/28/collecting-errors.aspx#comment-28</guid>
		<description>When I&#039;m not using WebForms, I solve input validation by using Presentation Model, i.e. special crafted DTOs to collect&amp;carry user input to validation service.

To display notifications (validation/other errors) I use age old notification pattern, which simply is a collection of messages to display .

I&#039;ve also had my take on validation &quot;framework&quot; with empathis on fluent construction of validation rules which looked good enough for C# 2.0 Haven&#039;t had a chance to come back to it with C# 3.0 yet :)</description>
		<content:encoded><![CDATA[<p>When I&#8217;m not using WebForms, I solve input validation by using Presentation Model, i.e. special crafted DTOs to collect&#038;carry user input to validation service.</p>
<p>To display notifications (validation/other errors) I use age old notification pattern, which simply is a collection of messages to display .</p>
<p>I&#8217;ve also had my take on validation &#8220;framework&#8221; with empathis on fluent construction of validation rules which looked good enough for C# 2.0 Haven&#8217;t had a chance to come back to it with C# 3.0 yet <img src='http://lostechies.com/mokhan/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Maxim Tihobrazov</title>
		<link>http://lostechies.com/mokhan/2008/10/28/collecting-errors/#comment-27</link>
		<dc:creator>Maxim Tihobrazov</dc:creator>
		<pubDate>Wed, 29 Oct 2008 11:39:24 +0000</pubDate>
		<guid isPermaLink="false">/blogs/mokhan/archive/2008/10/28/collecting-errors.aspx#comment-27</guid>
		<description>There are two more levels of validation:

the one you&#039;ve mentioned validates only objects, but sometimes you can&#039;t create object because of incorrect user input and sometimes an error occur during saving object to the database for example. And all these issues should be reflected in UI in the same way.</description>
		<content:encoded><![CDATA[<p>There are two more levels of validation:</p>
<p>the one you&#8217;ve mentioned validates only objects, but sometimes you can&#8217;t create object because of incorrect user input and sometimes an error occur during saving object to the database for example. And all these issues should be reflected in UI in the same way.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
