If I am not completely off-track it could work like this:

In a CompanyProjectDTO include the CompanyDTO and the
ProjectDTO as attributes with corresponding getter- and
setter-methods.

Then access them in the form like: compProjDto.myCompany.companyAttribute

hth
Alexander 

-----Original Message-----
From: Leandro Melo [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 06, 2004 11:28 PM
To: struts jakarta
Subject: 1:N relationship - ActionForms x DTOs

hi,
unfortunatelly i got my action forms coupled with my
DTOs . This is a very common disucussion in which i
don't want to go to the merits of it right now.

I just need a solution for a specific problem, but if
this solutions requires going back to the first point,
it's ok.

I'm used to have jsps that are "coupled" with my dtos,
so for a page in which the user regiter data about the
company, there's a CompanyDTO object that will
transfer the data from the Action to the persistent
layer.
Also i have an analogue ProjectDTO which transfer data
from Action to persisten layer.

The page used to register a company has a form bean
with fields that matches the CompanyDTO data type.
The page used to register project data has a form bean
with fields that matches the ProjectDTO.

Now, i have a new page for user to input data about
the company and it's projects. A better approach would
be building a "new" form bean and a new ActionForm
with both the company fields and the project fields.
Naturally this "new" form bean and ActionForm would
like just the same as the CompanyActionForm +
ProjectActionForm, so i thought if there's a way i can
reuse my ProjectActionForm and my CompanyActionForm to
build a CompanyProjectActionForm without having to go
with all the fields one by one for this action Form.
Is there a way to do that???
So i would have an CompanyProjectActionForm "composed"
by two other ActionForms, instead of having to write a
whole new CompanyProjectActionForm.

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.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]

Reply via email to