The CompanyForm.java is actually used to populate the values in the drop downs on the JSP.So, it contains the employee list and department list.
Where as the CompanyVo.java is the one which I use to persist data in the DB and any other business process.
The normal approach I see in many projects is to maintain 2 different Classes as mentioned above.Once the user submits the form,We get the form values in the action/controller in the EmployeeForm.java and then we copy each and every value to EmployeeVo.java
Let us say companyForm.java and companyVo.java contains another 15 variables each. In this case,the copying from form object to value object looks tedious and unnecessarily increase the lines of code and also its difficult to maintain as any change to Form object or value object will effect the code where we do the copy.
Is it not good to have only one class instead of having two different classes(EmployeeForm,EmployeeVo)
I didn't really follow your example, but maybe I was not patient enough to study it thoroughly. In general, a program is easier to maintain and modify if the data is kept separate from the user interface.
Learning Java using Eclipse on OpenSUSE 11.2
Linux user#: 501795