I have a swing application, which includes a lot of validation in the
client side,
For Eg.
1, If you select a particular value in a combo box, one radio-button
should be grayed
2, If one check box is selected, one item should be added to a combo
box
Is there any approach so that I can put all these kinds of validations
into a config or an XML file so that validations would be done
accordingly? If some one has done anything similar to this, pls guide
me. Any help would be appreciated.
regards
sarath
Roedy Green - 17 Jul 2007 20:34 GMT
>Is there any approach so that I can put all these kinds of validations
>into a config or an XML file so that validations would be done
>accordingly?
Here are some approaches I would consider:
1. write a preprocessor so you can embed boilerplate generating code
in your Java.
2. write you apps in some new terse syntax, and convert them to Java
source.
3. write your java app in some new syntax (that allows calls to
dynamically loaded Java classes for complex logic). Generate a set of
objects. Send that tree to the app from the server. It then generates
the widgets. In your syntax make use of the LIKE verb to bulk copy
attributes from various template objects. It gives you a very
flexible form of inheritance.
see http://mindprod.com/jgloss/parser.html
XML is harder to maintain that Java source.

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com