Validation Block

Posts   
 
    
KristianP
User
Posts: 32
Joined: 23-Feb-2005
# Posted on: 14-Dec-2006 20:25:47   

Looks like Patterns and Practice Group as M$ is coming out with a new Validation Block.

http://blogs.msdn.com/tomholl/archive/2006/11/27/validation-application-block-revealed.aspx

Frans, is there anyway in the future we could possibly have something similar to this build-in to the framework? It would be a very nice flexible option for standard validations and such.

so you could simply say..


if (!entity.IsValid)
{
    MessageBox.Show(entity.BrokenRules.ToString());
}

At least now we could feel alittle more 'Domain-Driven' simple_smile

PilotBob
User
Posts: 105
Joined: 29-Jul-2005
# Posted on: 14-Dec-2006 22:57:41   

KristianP wrote:

so you could simply say..


if (!entity.IsValid)
{
    MessageBox.Show(entity.BrokenRules.ToString());
}

At least now we could feel alittle more 'Domain-Driven' simple_smile

You can already do:


if (!entity.IsValid)
{
    MessageBox.Show( ((IDataErrorInfo)entity).Error );
}

How is the above better?

BOb

KristianP
User
Posts: 32
Joined: 23-Feb-2005
# Posted on: 14-Dec-2006 23:03:34   

Well, with an object based rule system, things are alot more flexible. Not only can we use encapsulate and re-use common validators, but we can also plug-in our own rules based on certain context at run-time.