On Fri, 2006-01-06 at 20:49 +0000, Niall Pemberton wrote:
> ----- Original Message ----- 
> From: "Frank W. Zammetti" <[EMAIL PROTECTED]>
> Sent: Friday, January 06, 2006 8:21 PM
> 
> >  Not at all a significant enhancement, but
> > think of all the things you could then do.  How about a simple flag to
> > tell the RP to populate the Action rather than an ActionForm, thereby
> > giving Michael his dream of a combined Action and ActionForm?
> 
> Again for the same reasons as above this should be straightforward to do in
> Struts 1.3 - you could use a property on the ActionMapping to flag this and
> replace the PopulateActionForm command with one that populates the Action.
> In this case though as well as configuring the chain to use the custom
> Command, you will also need to change the sequence of Commands since the
> Action is currently created after the ActionForm is populated.

related to this, sort of, on this page:
http://struts.apache.org/struts-action/roadmap.html

under the "Struts Action Framework 1.5.x considerations" heading it says:
"Consider a "populate" method on ActionForm. From an OOP standpoint, 
it might be cleaner if an ActionForm populated itself rather than 
rely on a "god" class to populate it from the outside."

It seems that even if you change the process, as stated in the original post, 
to populate the Action instead of the ActionForm, it would still be nice to 
allow
the population method to be controlled somehow, either by having a "populate" 
method
in the ActionForm or Action, or even declaring a populate class in the 
ActionMapping,
that could be any java class that defines a "populate" method.

Does anyone else care about this? Because i have an application in which i had
to extend the RequestProccessor, i overloaded the processPopulate method to 
check
the ActionForm for a "populate" method, via reflection, which would be run, if 
it existed. The application builds forms on the fly out of a set of 
form/page/field
definitions that exist in a database, each field having a "fieldType" that 
corresponds
to a class that defines a populate, validate and generateView method.

Dave


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

Reply via email to