I working on something similar right now too, but using the FormProc package. I believe that we should represent entire input form in XML, including things like the default control type and field labels, and so forth, along with prompts, error messages, validations, and type conversions. Ideally, we should be able to write a default form just by reference to an XML element.

What I like about FormProc is that is not focussed on JavaBeans, but on the process of validating a list of parameters against a form definition and then transferring the validated properties to some target object. The object can also be a Map, which makes for a very nifty hand-off to something like a Context. =:)

In fact, expanding on the DynaForm idea, it might also be possible to create a type-safe Context backed by a XML-configured form object. We could then use the same XML document on both layers. On the presentation layer, it can generate and/or validate the data-entry form. On the business layer, it can define the properties expected by a Context.

Of course, this is much like what we've been talking about doing for the Validator, but right now the emphasis there seems to be on the JavaBean and moving away from the form, where I believe we should be emphasizing the form and moving away from (pure) JavaBeans.

-Ted.

Don Brown wrote:
In the aforementioned stxx (http://stxx.sf.net) project, I've been working
on combining Struts with xmlforms (http://www.xmlform.org) to create
Struts ActionForms that use plain XML as the model.  Using pure XML as the
model has several advantages over javabeans I believe:

- Quicker development
- Use of XPath for powerful data access
- Many different validation options (schematron, xsd, relax-ng, etc)
- Ability to simultaneously expose forms as document-based SOAP web
services

While xml mapping toolkits have gotten better, I found keeping the model
in XML saves development time, and with xpath and JDOM, the data can be
accessed much quicker (in development time, not runtime of course).

Don




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to