Just wanted to chime in here. I have very specific goals that I am
trying to achieve, so I thought I would explain them in detail. (this
is something I've been tasked with at work)
1. We have a core product that is 'customized' for several client
implementations. Validation is an area where we have a need to
'customize' certain validation rules. I think a way to separate out
'rules' that can be referenced via a key and replaced via configuration
would work well here. Sort of a 'lite' rules engine targeted
specifically to validation.
2. Ideally I would want to combine our current XML and action.validate
validation. Right now we do the simple validation in XML and the rest
of the validation in action.validate. I would prefer to have all
validation in one place.
3. I want to be able to share validation between batch processes and the
UI. Right now it's somewhat challenging to reuse validation between UI
and batch processes. I would like one validation framework for both UI
validation and validation in batch processes--at least for writing of
the rules is concerned. Obviously there would need to be different
adapters to invoke the validation in different contexts.
4. Validation should be easy to write and easy to use. I don't want a
framework that is overly complex and hard to figure out. This is to
satisfy the KISS principle. (Keep it simple stupid)
So far, I like the grails validation the best. They have the concept of
a 'constraint', which is like a rule but can be referenced directly in
the groovy closure that defines the validation constraints. It should
be easy enough to create new closures that define more complex
validation directly in the closure.
The other 2 projects I've looked at are: http://oval.sourceforge.net/
and
https://springmodules.dev.java.net/docs/reference/0.8/html/validation.html#beanValidator.
Both have some interesting concepts, but neither of them satisfy all of
my needs out of the box.
So that's where I'm currently at. I haven't had much time yet to really
dig into this yet. Any additional ideas/suggestions would be greatly
appreciated.
Tom
rburton wrote:
Tom Schneider and a few other folks have been talking about validation in
Struts 2 and how it can be improved. I figured it would be useful to spawn a
thread in order to stir up some idea’s that may help inspire us. I know
validation isn’t an easy task, and some would argue it’s a cross cutting
concern; so does anyone have any idea’s on what they would like to see done?
How can the existing validation framework be improved? My only issue with
the existing validation framework is I can’t define validation rules which
can be referenced in my validation.xml file.
Any ideas would be greatly appreciated! Struts 2 => :rules:
Best Regards,
Richard L. Burton III
P.S. I hate being at work on Sunday morning at 1 AM EST time to do a
migration.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]