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]

Reply via email to