[prev in list] [next in list] [prev in thread] [next in thread] 

List:       struts-user
Subject:    RE: which method is better
From:       "Shasirekha Engala" <shasi.engala () patni ! com>
Date:       2006-02-28 12:28:11
Message-ID: 003301c63c60$c390ede0$3d481fac () patni ! com
[Download RAW message or body]

sending form reference to the model is not the correct way as it will make
model dependent on the view.
do not send the formbean object till the model.

-----Original Message-----
From: vasumathi [mailto:vasumathi@koensoft.com]
Sent: Tuesday, February 28, 2006 5:19 PM
To: Struts Users Mailing List
Subject: Re: which method is better


If you want to submit all the values to database, you can pass form ref.
but in case of submitting one or two values to database, what is the need of
sending form ref, we can pass those values itself.

> Hello,
>
> I usually have set and get methods for all properties in my Model class.
> After submitting a form, I pull out all the property values (form fields)
> in
> the Action class from the ActionForm object, set the values of all
> properties in the model from the action class and then call a particular
> method in the model class for final submission to the database.
>
> I wanted to know thether the above mentioned method is better or is it
> better to pass the form reference itself to the Model class which then
sets
> the values.
>
> In situation 2, I do not have to take care of the various String
references
> that I create. I simply will pass the ActionForm object to the Model
class.
>
> regards,
> vijay.
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>




---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic