On Sun, 8 Jun 2003, florian wrote:
> Date: Sun, 8 Jun 2003 20:00:31 +0200 > From: florian <[EMAIL PROTECTED]> > Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: endless actionforms and valueobjects questions > > > hi! > > i dont want to start the discussion again. just wanted some feedback > on some thoughs =) > > i had some dicussions with some friends who argued that valueObjects > should never never be so far out in the presentation layer. i kinda > agree > with that. valueObjects should really only be used on the borders of > layers. > > that however brings the question: why should i use something else > than strings in my actionforms? > Except for boolean properties that back a checkbox field, you should NOT be using other than strings in your form beans. A form bean is not a value object (as you have described it as being useful primarily between layers). Rather, a form bean is the sever side representation of the state of a particular form submit, and it belongs solely to the view tier. People who try to use a form bean as a value object, IMHO, are making a mistake. Instead, your Action should accept a validated form bean and copy the relevant information into a relevant value object. The BeanUtils.copyProperties() method is very helpful in performing the needed type conversions for such situations -- but back end business logic should NEVER need to import things like org.apache.struts.action.ActionForm. > ciao! > florian Craig McClanahan --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

