> In reality (in my current project), validation is not something that > changes once configured for a form and it does not need to be > completely decoupled from the Java form that it corresponds to. It's a > Struts project, but in the big picture of validation there is not much > difference in how it works... there is a validation.xml file that > declares stuff like XWork's validation XML file and the framework takes > care of the dirty work.
Yup, and it really becomes hard to manage tens of validation.xml files in a big project. Code and validation are very close to each other. For example, if I pull-up a field along with its @validation stuff to a base class the next build should introduce a validation.xml file for the base class. Refactoring and managing the project becomes way easier. > > So, in all seriousness, what does this gain you over a doValidate > > method? Not to mention the fact that based on the sample you've > > provided, you lose i18n and different date formats (12-22-2002 would > > look very strange outside of the US). IMHO this is exactly the kind of > > misuse that the core xdoclet people (Aslak/Ara) have expressed a > > dislike for. > > What does it gain you? Having validations in a config file outside the > source gives you the ability to use validation at multiple tiers - the > SAME validation - JavaScript in the browser, web-tier with WebWork, and > then even lower in business tier if desired. I have used the Struts > JavaScript validation piece without having to write anything, just > simply drop in a taglib into the page and the same validation is done > client-side. That is sweet! Good points. A separate file for validation is cleaner, separation of concerns you know. A @tagged solution is even cleaner imho, you still see very clearly what the validation logic for a field is (rather than possibly a messy code in doValidate covering dozen fields) and it's refactoring friendly too. That said this 1-1 mapping between code and validation should be investigated more. Such a 1-1 mapping sometimes makes things harder, for example if you tag an ejb with xdoclet then how do you deploy it to two jndi names configured to behave differently (different field groups for example)? Ara. ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01 _______________________________________________ Opensymphony-webwork mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork