On 7/7/05, Laurie Harper <[EMAIL PROTECTED]> wrote:
> Vincent wrote:
> >
> > 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.
> 
> Personally I prefer to keep form beans and value objects seperate, for two
> key reasons:
> 

+1 as well, and this matches the historical reason that form beans
were invented in the first place.

Form beans are part of the *view* tier, not the model ... their
purpose in life is to represent the server side state of the HTML
elements on a form, even if that state is invalid (i.e. not currently
passing all the validations).  That way, you can reproduce what the
user typed so he or she can fix it, rather than presenting them with a
completely blank screen.  (This is why you generally use string fields
in a form bean).

In a component oriented framework like JSF or Tapestry, you don't need
to worry about keeping track of this state information ... the
components do it for you.  But in Struts it is the application
developer's responsibility to understand the correct design patterns
-- and this is one of the most fundamental principles of how Struts
was designed.

Craig

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

Reply via email to