hi
Yes you are right, the basic reason for making variables private is for data hiding, and by making them public, you are in a way violating the basic concept of data hiding that Objects provide you. This statement is particularly debate able since all that you are creating is Value Objects that do on contain any processing but just act as a Storage area for transferring data from one tier to another.
I have almost the similar problem in the project that I am working on, we are using Value Objects as the super class to the Entiy Bean class, since we are using Container Managed Persistence all the attributes of the Value Object have to declared as public. The reason for this inheritance is to increase code reuse and reduction in code duplication that results in creating two classes that contain exactly the same fields. I feel that since I am extending Entity Beans from Value Object and the Entity Bean (with Container Manager Persistence) requires that all the database field variables be declared as public, it is all right to use this
pattern even though it does not stick the OO Concept of Data encapsulation.
I hope I was helpful :-)
Vivek Viswanathan
Vivek Viswanathan SCJP 1.2, SCJP 1.6,SCJD,SCEA,SCWCD,IBM-484,IBM-486,IBM-141,Ms.NET C# 70-316,SCMAD, LPIC-I