Hey Alan,

It seems to be a pretty popular mechanism out there.
Anyone else have any other ideas? And Alan, dig deeper
into the API - it does more conversions than you think
:)  

For a while I had protected (my form would be in the
same package as my action) 'convienence methods' for
converting between value objects and actionforms. 
Later I went to using another layer of indirection
with a separate class.  But, using the BeanUtils has
made my life easier.  Be careful with 'Date' things
though.  Good luck.

-Blake

--- "Weissman, Alan" <[EMAIL PROTECTED]> wrote:
> Thanks Blake!
> This doesn't seem as comprehensive a tool or design
> pattern as I would have
> liked.  Is this what everyone is using?  It seems
> like a lot of work,
> especially because it doesn't do data type
> conversions for you!
> Alan
> 
> -----Original Message-----
> From: Blake Whitmore
> [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, June 18, 2003 11:14 AM
> To: Struts Users Mailing List
> Subject: Re: Making Value Objects Into Form Objects
> 
> 
> Alan,
> 
> A good tool for this is the
>
org.apache.commons.beanutils.BeanUtils.copyProperties()
> method.
> 
>
http://jakarta.apache.org/commons/beanutils/api/org/apache/commons/beanutils
> /BeanUtils.html
> 
> 
> 
> 
> --- "Weissman, Alan" <[EMAIL PROTECTED]> wrote:
> > 
> > Ok so I'm a little new to Struts but not J2EE and
> > I've been noticing that my
> > Value Objects that come out of EJB's in my data
> > layer are the exact same
> > objects as the ActionForms that are used by
> > Struts....and I'm sure I'm not
> > the first to notice this.
> > 
> > So here's my question:  How can I make one class
> > that can serve as both an
> > ActionForm and a ValueObject?  
> > 
> > The problems with solutions that I've brainstormed
> > are this:
> > 
> > 1) I can't make my Value Objects extend ActionForm
> > for obvious reasons.
> > 2) I would rather not use an interface to get
> around
> > this issue because then
> > I have two classes to maintain again.
> > 
> > Thanks for any advice!
> > 
> > Alan
> > 
> > 
> >
>
---------------------------------------------------------------------
> > To unsubscribe, e-mail:
> > [EMAIL PROTECTED]
> > For additional commands, e-mail:
> > [EMAIL PROTECTED]
> > 
> 
> 
> __________________________________
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!
> http://sbc.yahoo.com
> 
>
---------------------------------------------------------------------
> 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]
> 


__________________________________
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!
http://sbc.yahoo.com

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

Reply via email to