2 Replies Latest reply on Feb 20, 2003 10:36 AM by Thomas Roka-Aardal

    ClientValidation interceptor

    Thomas Roka-Aardal Newbie

      I don't know if this has been discussed previously, but I had a brief talk to Juha in atlanta about this, and here is what I think...

      We could have a client-side interceptor that does logic validation, not just interface-compliancy. This means, we could write a configuration for the interceptor that defined a class name, a method signature, and a set of rules for each method. These rules I'm not sure how best to implement, but they could be something quasi-programmatic like "$1 > 0" or "name not null" etc. Okay, more about that later.

      Now, the proxy generated when you return to the client now includes a client-side validation scheme, which intercepts immediately after the deconstruction of the typed interface, and cheks the invocation to see if there are rules for this method on this class. If so, it checks the parameters, and throws a validation exception back to the client (with for instance a user-defined rule fail message).

      This means two things:

      * First of all we can throw exceptions back to the client immediately, without even going to the server side.

      * Second, we can now hot-plug logic validation into existing classes without touching the implementation. For future use, we could even drop writing this code in our beans, and just do it declaratively in the interceptor configuration instead.

      I know a few projects have been doing this in some way or another, but since we have a client side stack of interceptors, doing it in jboss should't be hard at all.

      Any ideas?

      thomas