(It was Konstantin Pribluda that wanted to trash ActionForms.)

People have often brought up things like multiple ActionsForms up on
the user list, but it seems like a misuse of the ActionForm to me.

An ActionForm is best used to represent the input needed to service a request.

Ideally, an Action should be able to take that input and pass it to a
single method on a business facade. Behind the facade, the business
layer might want to disburse that input into a graph of multiple
objects, but that sort of thing should be outside the scope of Struts.

In the Struts 1.x era, some of us started to put other things on
ActionForms besides the input needed to service a request, mainly
because the JavaBeans were a nuisence to maintain.

For Struts 1.1 and beyond, a very excellent approach is to use
finely-grained DynaActionForms to represent the input for a particular
form. This can lead to maintaining an attribute in more than one
formbean, but, since it's all in XML, IMHO, the duplication is
trivial.

Without a very compelling use case, I'd tend to be -1 on changing
ActionMappings to support multiple ActionForms. The idea is contrary
to the arcitectural design, just as multiple Actions would be.

Of course, in servicing a request we might need to call multiple
commands and tend to multiple objects, but there's an "M" in MVC.

Though, one scary thing about CoR is that it's going to make it much
easier for people to modify Struts to do things like this. For
example, multiple formbeans could be loaded into a custom
ActionMapping via set-property and then processed by replacing a
Command or two in the Chain.

It doesn't bother me that people will be able to go off in directions
like these with their own extensions, so long as the cannonical
architecture remains clear.

-Ted.


On Thu, 17 Mar 2005 06:05:59 -0800, Dakota Jack <[EMAIL PROTECTED]> wrote:
> I note below my biggest WISH for Struts that would be easy to
> accommodate and which would transform the usefulness of Struts, in my
> opinion, in a MAJOR way.
> 
> <SNIP>
> On Thu, 17 Mar 2005 06:33:42 -0600, Joe Germuska <[EMAIL PROTECTED]> wrote:
> > Jack, if you want to throw away ActionForm -- go for
> > it!
> </SNIP>
> 
> I have no interest in throwing away ActionForm.  I am a huge advocate
> of the use of <html:form> tags.  Since you seem to think that this
> somehow is or was a desire of mine, I should say that has never been
> and never will be my desire.  Rather, I would prefer if we could make
> ActionMappings such that a single action could result in the
> instantiation of two or more ActionForm objects rather than one.  This
> would simply my architecture immensely.  This also would be easy to
> do.  This would allow coders to be action-centric rather than
> page-centric and still be able to tie ActionForm, as originally
> envisioned, to <html:form>.  As things are now, an OOP programmer has
> to use one ActionForm to span two pages.
> 
> Jack

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

Reply via email to