Skip to main content

Form Validation in an SOA context

Posted by johnreynolds on December 3, 2005 at 9:04 AM PST

This blog continues the classic client-side versus server-side validation discussion, but now adds another layer - web service "side" validation. How can you share validation logic across client-side JavaScript, Java within the web application, and Java within underlying web services?

Validation of user input has always been an important aspect of user interface programming. You have to make sure that the values a user provides to your program are of the right type, in the right range, etc. and you should provide meaningful feedback to help users correct any errors.

I have often blogged my opinion that validation rules are business logic, and that they should not reside in the presentation layer. The presentation layer may apply validation rules, but developers should not have to modify presentation layer code (including JSPs) when validation rules change.

Please note that when I use the terms


Infrastructure stubs

The only way out I see by now is to use model driven tools that will generate all infrastructure code for you. There are quite decent out-of-the-box tool chains which implement true or alike MDD paradigm, or if none of these fit your needs you can either use DSM tools like Jetbrains MPS (AST builder + velocity/freemarker), Eclipse xText/EMF or create your own customized solution.