I usually build my ActionForm classes with the VO on it as a property. 

The String properties can be just refered to as bean.property on the jsp.

Any non-string properties I map to the bean in the action form, with
the translation - so if there is a date, for instance, the property on
the action form might be someDate, and in it's setter, i store the
string, parse it using a dateformat object, and store it into the bean
if it is a valid format. If the format is bad, i keep the string for
display back to the user.

That way, by the time the action gets the form the bean has all the
properties and the types are correct.

Larry


On 7/7/05, Vincent <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I'm currently designing and developping an enterprise J2EE application
> based on Struts.
> In this application there's a layer of Data Access Object which abstract
> the underlying persistent storage.
> For populating my struts' *Form I've imagined first a transfert between
> forms and DAO based on Value Object, associated with helper classes for
> translating from one type to another.
> And I realized that struts Form can be in some situations quite good
> transfert objects, and by doing so we economize development of both
> helper classes and VO classes.
> 
> What do you thing about using forms as VO? Do you think it's a dirty
> solution? Forms are often mirrors of the database's table.
> 
> Thank you for your opinion.
> 
> Vincent.
> 
> 
> ---------------------------------------------------------------------
> 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