Hi friends,
I am very confuse that how i should use POJO in actionform
In order to provide for clean separation between tiers, web application architectures often include delegates, proxies, or fa�ades that can be called from the web tier to store and retrieve data.Often, the lower tier uses
POJOs as data transfer objects (DTOs).
Now there are 2 ways to define actionform
now this is our DTO :
Employee pojo public class Employee implements Serializable
{
private static final long serialVersionUID = 1L;
private Integer employeeNumber;
private
String firstName;
private String lastName;
..
public Integer getEmployeeNumber() {
return employeeNumber;
...
}
1.
public class EmployeeForm extends ActionForm implements Serializable{
private static final long serialVersionUID = 1L;
private Employee employee;
...
}
2.
public class EmployeeForm extends ActionForm implements Serializable{
private static final long serialVersionUID = 1L;
private Integer employeeNumber;
private String firstName;
private String lastName;
..(all the properties whic are there in pojo)
...
}
I just want to ask what is the best approach?
thanks,
Nishita