You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@struts.apache.org by Martin Cooper <ma...@tumbleweed.com> on 2001/01/14 07:16:04 UTC
Automatically generating form beans
I'm working on a tool that generates the Java code for form beans from an
XML definition of those form beans. I believe what I'm doing corresponds
largely to the "XML -> ActionForm Code Generator" task on the Struts 1.1
TODO list. I'd be happy to volunteer for this task, as long as my company
will go along with it. In any case, I have some questions for the struts-dev
community.
The current Struts code base indicates that some thinking has already been
done along these lines, and I'd like to find out where that is heading.
For example, the struts-config.xml for the example contains the following
comment:
NOTE: You would only flesh out the details in the "form-bean"
declarations if you had a generator tool that used them to create
the corresponding Java classes for you. Otherwise, you would
need only the "form-bean" element itself, with the corresponding
"name" and "type" attributes.
and the DTD allows nested set-property elements within a form-bean element.
So, some questions about this:
1) What other fleshing out is in mind other than the use of set-property
elements?
2) The set-property element allows the specification of name and value,
which makes sense when the bean is being used. However, for bean definition,
name and type would seem more appropriate. I'm guessing that this is more
like a "thinking out loud" thing, and that it's part of what needs fleshing
out. Is this correct?
3) One addition that I have thought about some is field validation - that
is, somehow specifying via XML what the ActionForm validate() method should
do. Any thoughts on how best to do this?
What other ideas do people have? I know Struts 1.0 isn't quite done yet, but
hey, there's no harm in thinking ahead, right?
Thanks!
--
Martin Cooper
Tumbleweed Communications