Hi all, a few questions...

1) I haven't used Dynamic Action Forms yet, but am planning to on this
next application. Are there any issues I should be aware of trying to
create a DTO (or Value Object) from a Dynamic Form? In other words in
my  action class can I (should I?) do something like:

EmployeeDTO empDTO = MyHelper.makeEmployeeDTO( (DynaActionForm)form );

2) Should the DTO (or Value Object) do the conversions to the correct 
data types that the database table will need? If not where should these 
conversions be done when you need to do an insert/update?  

3) My database updates/inserts etc will be done through typical JDBC. 
Say I have an Action class that successfully creates a DTO from a 
DynActionForm. Now I want to insert this information into the DB. It's 
probably best to now pass this DTO off to some business layer that could 
then call a DAO to do the insert(?). But I'm still confused about what 
should be passed to the DAO in order to do the insert? Do I pass a 
DTO/Value Object directly to a DAO method from my business layer:

    class BusinessComponent { 
         employeeDAO.insertEmployee( employeeDTO ); 
    }

or does maybe my BuisnessComponent layer create an Employee object from 
a DTO and then you just call insert() on the Employee which wold insert 
from the Employee fields? 

    class BusinessComponent { 
        Employee emp = new Employee( employeeDTO ); emp.insert() 
    }

    class Employee {
        insert() { employeeDAO.inserEmployee( this ); } 
    }

Thanks for the help with this. I'm 'close' (I think) to getting where I 
want to be with this, but the points above are still troubling me. To 
sum up what I need clarification on (which includes a few points not 
listed above ).

    o Assuing using JDBC, add you have a DAO:

      a. What does it return if you need back single Employee info? 
         (Should it first create an Employee from a query then convert to 
         DTO and return that? or maybe it's best to return a RecordSet of 
         the table info? )

      b. What about a Collection of Employee information? 
         (return a Collection of EmployeeDTOs...or again maybe a 
         RecordSet?)

      c. Inserts/Updates? What do you pass to the DAO ? ( If you pass in 
         a DTO is the DAO then responsible for conversion of the 
         DTO strings or should the DTO be taking care of that? Pass it 
         an actual object like Employee which is made from a DTO? If so, 
         where is Employee made.. if made in the business layer doesn't 
         this break the rules of not passing an entity object around?

    o  Any problems making DTOs/Value Objects from Dynamic Forms?
    
    o  I take it if I use a Dynamic form I can't wrap a DTO in it,
       so is the solution just a helper class to make your DTOs ?


Thanks so much again.

Rick            


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to