<?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: Entity Validation Ideation</title>
	<atom:link href="http://lostechies.com/seanbiefeld/2009/02/15/entity-validation-ideation/feed/" rel="self" type="application/rss+xml" />
	<link>http://lostechies.com/seanbiefeld/2009/02/15/entity-validation-ideation/</link>
	<description>curiosities of development, life, the universe and everything</description>
	<lastBuildDate>Thu, 16 May 2013 18:55:00 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4.2</generator>
	<item>
		<title>By: Mario T. Lanza</title>
		<link>http://lostechies.com/seanbiefeld/2009/02/15/entity-validation-ideation/#comment-1825</link>
		<dc:creator>Mario T. Lanza</dc:creator>
		<pubDate>Thu, 16 May 2013 18:55:00 +0000</pubDate>
		<guid isPermaLink="false">/blogs/seanbiefeld/archive/2009/02/14/entity-validation-ideation.aspx#comment-1825</guid>
		<description>There are different flavors of validations.  We have garbage validations (don&#039;t allow bad data into a field) and relational validations (ensuring a proper multi-model construct where things are properly related in a graph) and business rule validations (particular to what makes sense in our domain&#039;s workflow).  Consider during a user session a user will have this interim state where he&#039;s building up the transaction data.    During the entire interaction as he moves from start to finish, we are at many times in a broken state violating rules on these three levels.  

Over what construct are you proposing your proactive validations be run?  Are they being run over the controls or over some data model that is built up behind the controls?

In a CRM, we have customer records, contact records (emails, phone numbers), address records, and purchase order records which themselves have line item records.  Our business rules state: we never create a customer record until we have their first order and a customer must have at least one point of contact and one address.  For a customer service rep to take a sales call, he has to build up that first transaction.  From a human standpoint there is no way he can enter all these parts simultaneously, so he has to build up that transaction into an acceptable state.  That build up must occur somewhere.  Where? I&#039;m assuming a data model.  I&#039;m assuming we run our validations over that &quot;working&quot; data model before we persist it.


However, remember that during the build up of the transaction we have partial data that is not ready for a commit.  In my mind that working data model is the source from which we persist.  Are you recommending that we have a clean model that is never in an interim, broken state and a separate working model that may be?  And if so, won&#039;t reconciling those two representations pose a huge synchronization mess?  I need a little help in realizing the semantics of how one might implement proactive validations.  I have always allowed the working model (the one being built up in the session) to exist in a broken state.  I just required that the state be fixed before a commit.</description>
		<content:encoded><![CDATA[<p>There are different flavors of validations.  We have garbage validations (don&#8217;t allow bad data into a field) and relational validations (ensuring a proper multi-model construct where things are properly related in a graph) and business rule validations (particular to what makes sense in our domain&#8217;s workflow).  Consider during a user session a user will have this interim state where he&#8217;s building up the transaction data.    During the entire interaction as he moves from start to finish, we are at many times in a broken state violating rules on these three levels.  </p>
<p>Over what construct are you proposing your proactive validations be run?  Are they being run over the controls or over some data model that is built up behind the controls?</p>
<p>In a CRM, we have customer records, contact records (emails, phone numbers), address records, and purchase order records which themselves have line item records.  Our business rules state: we never create a customer record until we have their first order and a customer must have at least one point of contact and one address.  For a customer service rep to take a sales call, he has to build up that first transaction.  From a human standpoint there is no way he can enter all these parts simultaneously, so he has to build up that transaction into an acceptable state.  That build up must occur somewhere.  Where? I&#8217;m assuming a data model.  I&#8217;m assuming we run our validations over that &#8220;working&#8221; data model before we persist it.</p>
<p>However, remember that during the build up of the transaction we have partial data that is not ready for a commit.  In my mind that working data model is the source from which we persist.  Are you recommending that we have a clean model that is never in an interim, broken state and a separate working model that may be?  And if so, won&#8217;t reconciling those two representations pose a huge synchronization mess?  I need a little help in realizing the semantics of how one might implement proactive validations.  I have always allowed the working model (the one being built up in the session) to exist in a broken state.  I just required that the state be fixed before a commit.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mitch</title>
		<link>http://lostechies.com/seanbiefeld/2009/02/15/entity-validation-ideation/#comment-7</link>
		<dc:creator>Mitch</dc:creator>
		<pubDate>Tue, 02 Feb 2010 17:26:12 +0000</pubDate>
		<guid isPermaLink="false">/blogs/seanbiefeld/archive/2009/02/14/entity-validation-ideation.aspx#comment-7</guid>
		<description>Wait how can someone comment and rip apart Sean&#039;s case with Reactive and Proactive Validation without coming up with a more viable solution.  To me, this is why one should make an honest attempt in not disrespecting someone who obviously has more skills in code than you do.  I&#039;m going to look and see how these reflect on what I&#039;m doing along w/ Mr. Bogard&#039;s post.</description>
		<content:encoded><![CDATA[<p>Wait how can someone comment and rip apart Sean&#8217;s case with Reactive and Proactive Validation without coming up with a more viable solution.  To me, this is why one should make an honest attempt in not disrespecting someone who obviously has more skills in code than you do.  I&#8217;m going to look and see how these reflect on what I&#8217;m doing along w/ Mr. Bogard&#8217;s post.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: phdusj</title>
		<link>http://lostechies.com/seanbiefeld/2009/02/15/entity-validation-ideation/#comment-6</link>
		<dc:creator>phdusj</dc:creator>
		<pubDate>Sun, 27 Sep 2009 13:20:23 +0000</pubDate>
		<guid isPermaLink="false">/blogs/seanbiefeld/archive/2009/02/14/entity-validation-ideation.aspx#comment-6</guid>
		<description>b9CEwY  &lt;a href=&quot;http://ffkjelkrlbeb.com/&quot;&gt;ffkjelkrlbeb&lt;/a&gt;, [url=http://xkpcnazhyxfo.com/]xkpcnazhyxfo[/url], [link=http://ojuaedsdlkqy.com/]ojuaedsdlkqy[/link], http://nxazekgdeqht.com/</description>
		<content:encoded><![CDATA[<p>b9CEwY  <a href="http://ffkjelkrlbeb.com/">ffkjelkrlbeb</a>, [url=http://xkpcnazhyxfo.com/]xkpcnazhyxfo[/url], [link=http://ojuaedsdlkqy.com/]ojuaedsdlkqy[/link], <a href="http://nxazekgdeqht.com/" rel="nofollow">http://nxazekgdeqht.com/</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: derick.bailey</title>
		<link>http://lostechies.com/seanbiefeld/2009/02/15/entity-validation-ideation/#comment-5</link>
		<dc:creator>derick.bailey</dc:creator>
		<pubDate>Mon, 16 Feb 2009 14:36:14 +0000</pubDate>
		<guid isPermaLink="false">/blogs/seanbiefeld/archive/2009/02/14/entity-validation-ideation.aspx#comment-5</guid>
		<description>@Sean,

Also - in the case where you would want to create a new entity type based on the &quot;state&quot; of the data - that is, a &quot;SignedDrugOrder&quot; vs a &quot;DrugOrderRequest&quot; or something similar... I agree with the principle behind this, but I think we disagree in how we achieve this. 

I&#039;m not necessarily going to create an class hierarchy with inheritance to achieve this. Although I won&#039;t throw this out as an option. There certainly are times when this is desirable. It always comes down to the needs of the system being built. Rather, I like to employ the State Pattern for this type of need, which by definition is &quot;a clean way for an object to partially change its type at runtime.&quot; 

... just some additional things to think about. there are so many ways to accomplish the same things in software. I&#039;m very interested in seeing where you take all of this info and how you apply it in your code, moving forward. </description>
		<content:encoded><![CDATA[<p>@Sean,</p>
<p>Also &#8211; in the case where you would want to create a new entity type based on the &#8220;state&#8221; of the data &#8211; that is, a &#8220;SignedDrugOrder&#8221; vs a &#8220;DrugOrderRequest&#8221; or something similar&#8230; I agree with the principle behind this, but I think we disagree in how we achieve this. </p>
<p>I&#8217;m not necessarily going to create an class hierarchy with inheritance to achieve this. Although I won&#8217;t throw this out as an option. There certainly are times when this is desirable. It always comes down to the needs of the system being built. Rather, I like to employ the State Pattern for this type of need, which by definition is &#8220;a clean way for an object to partially change its type at runtime.&#8221; </p>
<p>&#8230; just some additional things to think about. there are so many ways to accomplish the same things in software. I&#8217;m very interested in seeing where you take all of this info and how you apply it in your code, moving forward. </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: derick.bailey</title>
		<link>http://lostechies.com/seanbiefeld/2009/02/15/entity-validation-ideation/#comment-4</link>
		<dc:creator>derick.bailey</dc:creator>
		<pubDate>Mon, 16 Feb 2009 14:24:28 +0000</pubDate>
		<guid isPermaLink="false">/blogs/seanbiefeld/archive/2009/02/14/entity-validation-ideation.aspx#comment-4</guid>
		<description>@sean,

you asked a question via twitter over the weekend. something to the effect of &quot;what&#039;s the difference between validation and business process or business logic in the domain model?&quot; ... i think that&#039;s a fair summary of the question.

for me at least, the difference is implicit vs explicit validation. you need to have valid data (explicit validation) before you can run a process. the process itself, is &quot;valid&quot; and produces &quot;valid&quot; results, assuming valid input. i consider this to be implicit validation. 

i think Jimmy said it best in his commentary on validation, over the weekend (http://www.lostechies.com/blogs/jimmy_bogard/archive/2009/02/15/validation-in-a-ddd-world.aspx): 

&quot;Instead of answering the question, “is this object valid”, try and answer the question, “Can this operation be performed?”. &quot;

this is the direction that I have been heading in the last few days, leading up to these conversations. it seems to be working pretty well, so far. instead of littering my entity with &#039;isvalid&#039; properties, i end up with services that say (in the case of needing to save the data to a dabase) something like &quot;CanSave&quot;. By moving the &quot;is valid&quot; check into the context under which validation must occur, we can simplify the entity and provide a replaceable / plugable solution for validation. 

the real problem after this is determining what is context dependent validation and what is truly the core needs of the entity or aggregate. if we&#039;re not careful, we&#039;ll end up in situations where we create anemic domain models simply because we want to move *all* logic (implicit and explicit validation) out into services. I&#039;m having a hard time combating this. it&#039;s hard to find the balance.</description>
		<content:encoded><![CDATA[<p>@sean,</p>
<p>you asked a question via twitter over the weekend. something to the effect of &#8220;what&#8217;s the difference between validation and business process or business logic in the domain model?&#8221; &#8230; i think that&#8217;s a fair summary of the question.</p>
<p>for me at least, the difference is implicit vs explicit validation. you need to have valid data (explicit validation) before you can run a process. the process itself, is &#8220;valid&#8221; and produces &#8220;valid&#8221; results, assuming valid input. i consider this to be implicit validation. </p>
<p>i think Jimmy said it best in his commentary on validation, over the weekend (<a href="http://www.lostechies.com/blogs/jimmy_bogard/archive/2009/02/15/validation-in-a-ddd-world.aspx" rel="nofollow">http://www.lostechies.com/blogs/jimmy_bogard/archive/2009/02/15/validation-in-a-ddd-world.aspx</a>): </p>
<p>&#8220;Instead of answering the question, “is this object valid”, try and answer the question, “Can this operation be performed?”. &#8221;</p>
<p>this is the direction that I have been heading in the last few days, leading up to these conversations. it seems to be working pretty well, so far. instead of littering my entity with &#8216;isvalid&#8217; properties, i end up with services that say (in the case of needing to save the data to a dabase) something like &#8220;CanSave&#8221;. By moving the &#8220;is valid&#8221; check into the context under which validation must occur, we can simplify the entity and provide a replaceable / plugable solution for validation. </p>
<p>the real problem after this is determining what is context dependent validation and what is truly the core needs of the entity or aggregate. if we&#8217;re not careful, we&#8217;ll end up in situations where we create anemic domain models simply because we want to move *all* logic (implicit and explicit validation) out into services. I&#8217;m having a hard time combating this. it&#8217;s hard to find the balance.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: joe</title>
		<link>http://lostechies.com/seanbiefeld/2009/02/15/entity-validation-ideation/#comment-3</link>
		<dc:creator>joe</dc:creator>
		<pubDate>Sun, 15 Feb 2009 08:15:31 +0000</pubDate>
		<guid isPermaLink="false">/blogs/seanbiefeld/archive/2009/02/14/entity-validation-ideation.aspx#comment-3</guid>
		<description>@Sadek 

Then it would be another entity. </description>
		<content:encoded><![CDATA[<p>@Sadek </p>
<p>Then it would be another entity. </p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sadek Rady</title>
		<link>http://lostechies.com/seanbiefeld/2009/02/15/entity-validation-ideation/#comment-2</link>
		<dc:creator>Sadek Rady</dc:creator>
		<pubDate>Sun, 15 Feb 2009 07:09:44 +0000</pubDate>
		<guid isPermaLink="false">/blogs/seanbiefeld/archive/2009/02/14/entity-validation-ideation.aspx#comment-2</guid>
		<description>I think that &quot;Is Valid&quot; is not an intrinsic property of an entity. It is a relation between an Entity and a process or a service. The same entity with exactly the same state may be valid for certain processing and invalid for another type of processing.</description>
		<content:encoded><![CDATA[<p>I think that &#8220;Is Valid&#8221; is not an intrinsic property of an entity. It is a relation between an Entity and a process or a service. The same entity with exactly the same state may be valid for certain processing and invalid for another type of processing.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
