We instantiate an ActionForm from our model bean to move data from business to struts.
In each ActionForm, we have a populate method that fills in various pieces of a model bean for that particular form.
Is this fairly typical?
posted 11 years ago
The approach you describe is pretty common. One that I use quite often is the "Value Object" or "Transfer Object" pattern. Using this pattern, you create objects that belong neither to the view, nor to the model, but are used to shuttle information to and from the two. When using struts, I sometimes find it convenient to embed the value object into the form as a property, and then use nested tags to get at the information.
Here's a link with some good information about this and other J2EE patterns.