Im with camp 3 then I guess.

Way I see it , forms are view components, there to provide an object for
both action and JSP to be able to access the state of the screen. (Fields
values and other bits of information that are needed to recreate the html,
and a place to hold the state of the view (ie: submitted field values) on
the server side for the controller (action) to read from)

Maybe we should raise an issue in bugzilla against the userguide? Forms have
no business transfering stuff from view to model. The model should never
have to see an actionForm and should be blissfuly unaware of their very
existence. Thats the job of an action to do, taking data from the form, and
providing it to the model and vice versa (preferably with some kind of
helper classes and perhaps also non-form DTOs involved)

-----Original Message-----
From: Niall Pemberton [mailto:[EMAIL PROTECTED]
Sent: Friday, 27 February 2004 12:12
To: Struts Users Mailing List
Subject: Re: FormBeans: A question of Style


Dam - I was in Camp 3: Form beans are View components...but looking in the
user guide...

"Note: While ActionForm beans often have properties that correspond to
properties in your Model beans, the form beans themselves should be
considered a Controller component. As such, they are able to transfer data
between the Model and View layers."

Niall

----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 27, 2004 1:57 AM
Subject: FormBeans: A question of Style


>
> We have 2 camps of thought on the subject of the appropriate use of Struts
> form beans.  Here are the thoughts:
>
> Camp 1:  Form beans are controller components and should be used only to
> transport user input data between JSP forms (or across JSP forms) and
> Action classes.
>
> Camp 2: Form beans should be use for what "Camp 1" thinks, plus they
should
> also contain all the data a JSP uses to render a page (i.e. All the model
> data is inserted into the form bean as well as the form data.)
>
> Any thoughts?
>
> Scott
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>



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



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

Reply via email to