6

I am looking for validation framework and while I am already using NHibernate I am thinking of using NHibernate.validator from contrib project however I also look at MS Validation Block which seem to be robust but i am not yet get into detail of each one yet so I wonder has anyone had step into these two frameworks and how is the experience like?

0

4 Answers 4

10

NHibernate Validator does not require you to use NHibernate for persistence. Usage can be as simple as:

var engine = new ValidatorEngine();
InvalidValue[] errors = engine.Validate(someModelObjectWithAttributes);

foreach(var error in errors)
{
    Console.WriteLine(error.Message);
}

Of course it can hook into NHibernate and prevent persistence of invalid objects, but you may use it to validate non-persistent objects as well.

Sign up to request clarification or add additional context in comments.

Comments

0

For the most part I would say that Spring.NET is pretty independent. Meaning it should not force you to re-architect. You can use as much or as little as you want. It should be pretty easy to write an object that you can inject into classes needing validation using spring. You would then wire this object up in castle to take the name of the "Validation Group" or "Validators" you needed and then have spring inject the validators into that object where your form/business object/service would then use the validators.

Here is a link to the doc,Validation is section 12:

http://www.springframework.net/docs/1.2.0-M1/reference/html/index.html

Are you just using Castle or are you using Monorail?

Comments

0

Of course you can try to write your own validation framework. For eg. Karl Seguin will help you:

http://codebetter.com/blogs/karlseguin/archive/2009/04/26/validation-part-1-getting-started.aspx

http://codebetter.com/blogs/karlseguin/archive/2009/04/27/validation-part-2-client-side.aspx

http://codebetter.com/blogs/karlseguin/archive/2009/04/28/validation-part-3-server-side.aspx

It's really nice solution :)

Comments

-1

How about D) None of the above. I remember evaluating this last year and decided on going with Spring.NET's validation framework.

If your using NHibernate your probably want to use Spring.NET's facilities for using NHibernate as well.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.