If you're willing to have struts update the model directly, you can nest 
your model under a getter property in an object that extends ActionForm.
eg: getMyDataModel()
 From the property down, there never needs to ba any reference to struts 
again, besides the methods that provide usually simpler object types 
than the ones you need. However, you can usually write simple conversion 
code inside the objects that can turn it into something more useful when 
you need it. This way, the entire process is automatic, and doesn't any 
property copying/transfer.

In the JSP side of things, you can just write the nested version of the 
property.
eg: <html:txt name="myStuff" property="myDataModel.propertyInTheModel" />

If you want to go this way, I've heard that there's a nesting extension 
to make this easier too.
;)


Arron.


Taylor Cowan wrote:

>Perhaps we should move to the user list, not dev. but to answer briefly,
>
>ActionForm objects, <em>for me</em>, are strictly view layer.  They get data
>from the view to my model, so they are like glue.  They may perform some
>validation, like making sure a field is numeric or valid date.  I place an
>"update" method on my ActionForms that update my model, which keeps actions
>clean.
>
>Your model should have absolutely no knowledge of servlets or struts.  You
>should be able to compile the entire model layer without any web oriented
>classes.
>
>Taylor
>-----Original Message-----
>From: Allen [mailto:[EMAIL PROTECTED]]
>Sent: Thursday, November 29, 2001 12:59 PM
>To: [EMAIL PROTECTED]
>Subject: Re: General model question ?
>
>
>
>Which object type are people having their Action's send into their
>business and/or data layers: ones that derive from ActionForm or ones
>that implement the Value Object pattern? And how are they converting the
>business and/or data layer's response back (into Action Forms? or are
>you sending back the Value Object so that the custom tags can use
>that?).
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>



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

Reply via email to