Are u using EJBs or pure JAVA DAOs? If you are using EJBS, then u should not pass the actual beans and thats why Value Objects are used. Multiple calls to EJBs should be avoided. U can pass VO from the BO functions to the DAO. U are right that passing the values in the functions as u have done below is not the recommended practice. U can make ur VOs as updatable VOs which will accept data both ways from the client to the BO and from the DAO to the BO layer to update it with new values.
-Ranjan. -----Original Message----- From: Rick Reumann [mailto:[EMAIL PROTECTED]] Sent: Tuesday, May 28, 2002 1:27 PM To: Struts List; [EMAIL PROTECTED] Subject: Re: In regard to....Re: DAO- BO in Struts On Tuesday, May 28, 2002, 1:58:27 PM, Rick wrote: RR> BO RR> [ has method doInsert( DTO myDTO ) which here I would strip RR> out what I need from the DTO and then call the appropriate RR> DAOs and methods. For example: RR> EmployeeDAO.insertEmployee( myDTO.getName(), RR> myDTO.getAddress(), etc ); RR> SurveyDAO.insertSurvey( myDTO.getEmployeeName(), myDTO.getAnswer1(), RR> myDTO.getAnswer2(), etc ); RR> ] One problem I already see with this is my DTOs will probably have unformatted String fields and the DAO inserts etc would need the correct data types and formats (Date, int, etc ). So would maybe it be better do have a helper class in a BO create an Employee from the DTO (which would create the correct datatypes and formats ) and then pass this off to the DAO to do the insert or of course possibly having the object itself be able to take care of it. For example in the Business Object: EmployeeBean emp = MyHelper.makeEmployee( DTO myDTO ); EmployeeDAO.insertEmployee( emp ); OR EmployeeBean emp = MyHelper.makeEmployee( DTO myDTO ); emp.insertSelf(); // which would call a DAO The problem ( I think ) with even this solution is I'm told you shouldn't be passing around the actual entity beans like EmployeeBean in this case. So now I'm still confused:) -- Rick mailto:[EMAIL PROTECTED] "The difference between a man and a boy is, a boy wants to grow up to be a fireman, but a man wants to grow up to be a giant monster fireman." -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]>

