> Possible reasons why not:
>
> * You're currently still stuck with Struts 1.0.2 :-).
>
Not an issue post 1.0.2...
> * Non-trivial getter and setter implementations that do more than just
> manipulate an instance variable.
>
Couldn't this logic be moved to validate()? Something like:
public ActionErrors validate(ActionMapping mapping,
HttpServletRequest request) {
/*
* preValidate() performs get()/set() operations as required to
* perform non-trivial getter/setter functionality.
*
* This method essentially consolidates all the "non-trival
* getter and setter implementations" that would be required
* in a normal Form Bean.
*
* It could perform some validation as well and return ActionErrors.
*/
ActionErrors errors = this.preValidate();
// Now perform validation on the Dyna-data as you normally would...
....
return errors;
}
> * Required code in the no-args constructor (although in most cases you
can
> get around this by doing initialization in the reset() method instead.
>
Again, move to validate().
> An additional reason to consider them was added in a recent nightly build
> -- you can now conveniently initialize arrays of constants in your
> struts-config.xml file, which is very convenient for setting up standard
> options for an <html:select>, or the default set of values for an
> <html:multibox>. Example:
>
> <form-bean name="foo" type="org.apache.struts.action.DynaActionForm">
> ...
> <form-property name="optionsList" type="java.lang.String[]"
> initial="{ 'First option', 'Second option', 'Third option' }"/>
> ...
> </form-bean>
>
> The syntax for initializing an array is basically like what you'd use to
> initialize them in a variable declaration, except you can only use
> constants.
>
Tell me again why I should use the standard form beans?
I'm trying to understand because it seems to add complexity having two
different ways of doing Form Beans. Why not polish up the Dyna bean stuff
and then dump (er, deprecate) normal Form Beans?
One advantage I will give the normal Form Beans is that they are easier for
a newbie to pick up and learn. They shorten the learning curve to get
productive with Struts initially. But if DynaBeans were made to be very
easy, then this advantage may disappear as well.
Kevin
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>