Tell me if you think this qualifies...

We've put together a very simple VerificationService that seems to work fairly well, 
but is not yet fleshed out. It
relies on a rule interface and the fact that input needs to be considered in the 
context of an action. The service is
configured at startup with "action.input" keys and "rule.classname" values from an xml 
file. The service can load a rule
and execute it on a given input.

Inside of an Action module you can then write:

try{
TurbineVerification.validate(data);
}
catch(VerificationRuleFailureException e)
{
// do something appropriate
...

When the Action gets loaded, the service resolves which rules get loaded to test which 
inputs, throwing an exception if
there are any violations. The Action doesn't have to know about the rules at all, and 
if your boss suddenly wants an
input field to be alpha-numeric instead of numeric, its a configuration issue. The 
service could be applied to the
nefarious javascript or sql input cases with appropriate rule classes.

If anyone thinks this is a candidate for Turbine, we'd be happy to beef it up and 
contribute... any feedback would be
appreciated either way.

Chris
[EMAIL PROTECTED]



>
> I know it is a pain, but that is the way it is. You can probably write some
> helpful utilities if you are expecting the same type of data over and over,
> but for the most part, unfortunately it really isn't portable to a framework
> level.
>
> So, here is my challenge, prove me wrong and submit a class for Turbine. :-)
>
> thanks,
>
> -jon
>






------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Search: <http://www.mail-archive.com/turbine%40list.working-dogs.com/>
Problems?:           [EMAIL PROTECTED]

Reply via email to