views:

937

answers:

5

I once came across a validation framework for java, where you wrote one method that protected the integrity of the data-type and any CRUD operations on that data-type automatically called this method.

Does anyone know what this framework is?

+3  A: 

Don't know.

Apache Commons has a validation framework.

duffymo
+2  A: 

Spring has a very nice validation and binding API.

duffymo
A: 

Thanks Guys. Sorry I have been very vague.

I simply want to avoid repetitive validation on every CRUD method attached to a data-type.

bowsie
I'm still do not understand what exactly you want to validate? Could you explain on a real example?
gedevan
I think he wants something like value ranges and/or specific String patterns but I fail to see why there would be a specific framework this...maybe then it would make sense if the framework would specify that only object A can edit object B's field "c"?
Esko
The main idea as I always thought is to validate data values before CRUD operations. In this case I prefer making all the validations in the layer on top of DAO.
gedevan
Sure I want to validate value ranges and business logic. For instance a person cannot be a male and pregnant etc.I want to validate in the middle-layer, above the DAO layer. I don't specifically need to use a framework, but it would be helpful.
bowsie
Is it a web app? Are you already using any framework for your application?
Adeel Ansari
Yes it's a web application. Guice as Ioc framework, Stripes as front-end. Haven't committed to any of the above yet am considering options.
bowsie
+1  A: 

Here's a huge list of Java Validation Libraries / Frameworks - http://java-source.net/open-source/validation/commons-validator

Albert T. Wong
+1  A: 

Are you using Hibernate for persistence? If you are, there is Hibernate Validator.

andref