>>>>>>The only thing that will be tied with the Bussines Layer will be 
>>>>>>commons-beanutils.jar.
    What about the struts libs ? The ActionForm will be the Bean that is wrapped 
inside the DynaBean and it has refs to the struts as well as servlets package....

Perfromance ..as mentioned we have not yest benchmarked but we have not had any 
noticeable impact no the performance of the system when using DynaBeans...We are using 
them in the appserver layer though for transferring data from a resultset into a 
DynaBean and from there to a Value Object.

Sumit

-----Original Message-----
From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED]
Sent: Friday, November 14, 2003 2:54 PM
To: Struts Users Mailing List
Subject: Re: DTO pattern and WrapDynaBean


Yes, I know it holds the reference, but it could be a reference to any other
JavaBean. The only thing that will be tied with the Bussines Layer will be
commons-beanutils.jar. The ideea is to avoid creating new data transfer objects;
so the real debate here is that if the overhead added by getting the data in the
bussines layer, using reflection/introspection, is smaller than the overhead
added by creating another object and filling it with the data obtained from the
ActionForm and retriving this data in the bussines layer.

Ovidiu

----- Original Message ----- 
From: "Sumit S." <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Friday, November 14, 2003 10:07 AM
Subject: RE: DTO pattern and WrapDynaBean


I have'nt benchmarked the perf, but for our app we were not comfortable with
having the struts libs in the Application layer...The WrapDynaBean holds the
instance of the Action form and hence has references to the struts libs.

Sumit

-----Original Message-----
From: Ovidiu EFTIMIE [mailto:[EMAIL PROTECTED]
Sent: Friday, November 14, 2003 2:05 PM
To: Struts Users Mailing List
Subject: DTO pattern and WrapDynaBean


 Hi,
I've used until now the DTO pattern to transfer data from action forms to the
bussines layer , but I was wondering if using WrapDynaBean (that I've just
discovered) to wrap the action form an to pass it in a DAO class would have
a major inpact on performance.

For example:
===> in an Action (DocumentAction)

DocumentForm dcForm = (DocumentForm)form;
DynaBean wrp = new WrapDynaBean(dcForm);

DocumentDAO dbo = new DocumentDAO();

dom.insertDocument(getConnection(),wrp);


===>and then in the DAO class
public int insertDocument(Connection conn, DynaBean data){
    StringBuffer sbf = new StringBuffer();
    sbf.append("insert ......").appen(data.get("title")).append(",")
         .append(data.get("author")).append(")");
............................................
}
So the basic ideea is to use the wrapped ActionForm as a DTO.
Anyone has any comments?
Thanx
Ovidiu

ps: I'm reposting this beacause yesterday our mail server had some problems and
I'm not sure it was really posted on the list


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