To be more clear with DTO and its usage check this - http://www.martinfowler.com/isa/dataTransferObject.html.
U might want to check on the J2EE pattern called ValueObjectAssembler. -Ranjan -----Original Message----- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 3:31 PM To: Struts Users Mailing List Cc: [EMAIL PROTECTED] Subject: Re[2]: In regard to....Re: DAO- BO in Struts On Tuesday, May 28, 2002, 2:35:31 PM, Ranjan wrote: PR> U can pass VO from PR> the BO functions to the DAO. U are right that passing the values PR> in the functions as u have done below is not the recommended PR> practice. U can make ur VOs as updatable VOs which will accept PR> data both ways from the client to the BO and from the DAO to the PR> BO layer to update it with new values. Is it normal/standard to pass stuff in a VO (or DTO) that represents more than one object to the DAO ? In other words some of the literature says to grab as much information you can in the DTO/VO, such that you might get Employee information but also you might be gathering other information (maybe unrelated to the Employee object) also. So do you pass this whole Value Object over to the DAO ? If so, what if you want to reuse this DAO and only want to pass it a Value Object that only contains strictly Employee information? It seems that if you want to do that then you need to create another DAO ( or at least another method in the DAO ). I guess I'm confused since I thought the Value Object or DTO was basically a similar representation of the Action Form object ( yet obviously not tied to Struts ). If so in a sense it seems like if you pass this Value Object to the DAO layer it seems like the DAO will have to do too much work, and do work with an object which later on might change. In other words back to the example of a Value Object that captured both Employee Information from the form and also captured information they filled out like a survey. If this whole Value Object gets passed to the DAO, the DAO would then be responsible for breaking it apart into inserting the Employee and then also inserting the Survey. Shouldn't you maybe pass the Value Object to a business component that would break this Value Object into a couple smaller Value Objects and then pass those new Value Objects (ie EmployeeVO, SurveyVO ) onto the appropriate DAOs? -- Rick mailto:[EMAIL PROTECTED] "I'd rather be rich than stupid" -Jack Handey -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

