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

Reply via email to