> Fecha: Mon, 08 Jul 2002 23:37:03 -0400
> A: [EMAIL PROTECTED]
> De: James Turner <[EMAIL PROTECTED]>
> Asunto: RE: DynaActionForm Advantages 
> 
> My two cents on the topic.
> 
> As mentioned, once you move to a good Java IDE like
> JBuilder, writing 
> getters and setters is no longer nearly the pain it
> used to be.
> 

Correct--the ActionForm follows the standard JavaBeans
approach--reduced learning curve for newcomers, and
already generated by most IDE's.


> What bothers me about the DynaBean approach is that
> it's *yet another* 
> file, and *yet another* level of indirection that
> obscure what's really 
> going on.  I can look at an ActionForm, see all the
> properties, look at the 
> validation, all in one step.  Making it a DynaBean
> form means having to 
> maintain another file with the XML, always having to
> remember where it is, etc.
> 

Mostly agree.  It's not "yet another" file, because
DAF's were (I believe) originally designed to reduce
the number of ActionForms you'd have to implement. 
I.e., if you don't have any special validation to do,
don't bother subclassing an ActionForm--just put the
variables in the struts-config and you're done.  Very
nice design.

The problem was that the DAF class was not made final.
 Allowing it to be subclassed is creating the mess you
describe--the variables in the XML file and actions on
them in the DAF subclass.  (Another was writing about
putting member variable initializations in the
validate() function--the DAF subclass may also start
encouraging other messier programming habits.)

As for those who don't like getter/setters and want to
use the common-beanutils "get" functions described by
Craig:  Might it have been better, in addition to
making the DAF class final, to just have ActionForms
implement "get"'s interface? Just newbie thinking...

Glen


_________________________________________________________
Do You Yahoo!?
Informaci�n de Estados Unidos y Am�rica Latina, en Yahoo! Noticias.
Vis�tanos en http://noticias.espanol.yahoo.com

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

Reply via email to