----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, June 18, 2003 5:59 PM
Subject: RE: Making Value Objects Into Form Objects


>But can i have a beanList inside dynaAction form?Or the properties of the
dynaFOrm need to >be scaler properties?
>Because for me having nested beans is very important to have a proper OO
design.

To my knowledge, ActionForms are mainly used as means of collecting string
base input data from a form.
In which situation may you need nested beans as reference types?

Can you give me a clearer picture as to what you are going to be needing
nested beans for in your ActionForms to stick to proper OO design?

--Alen

>This is the only point holding me back.Any ideas?

-----Original Message-----
From: Alen Ribic [mailto:[EMAIL PROTECTED]
Sent: Wednesday, June 18, 2003 5:15 PM
To: Struts Users Mailing List
Subject: Re: Making Value Objects Into Form Objects



----- Original Message -----
From: "Weissman, Alan" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Wednesday, June 18, 2003 5:07 PM
Subject: Making Value Objects Into Form Objects


>
> 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?

use org.apache.struts.action.DynaActionForm (Or one of the Dyna validator
form classes)
and define form-bean in struts config file.

This way you will not need to define a ActionFrom for every form you work
with.

Then you use BeanUtils.copyProperties(...); method to copy bean properties
from one to you value object.

--Alen

>
> 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]
>


---------------------------------------------------------------------
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]





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

Reply via email to