Hello Glenn,
 
Our design has been made before Sun officially announced the concept of Date Transfer Object, it is therefore the name DTO does not exist in our architecture.
 
We do differentiate between read-write VO from read-only VO .
 
In it most simple form, a read-write VO does consists of getter and setter methods for all it fields.
 
In the later case, we achieve the result of read-only VO by defining a VO which uses its constructor to initialise all its fields and without defining any setter method.
 
We still have use-cases that a single VO will be used situationally as read-only and read-write VO, we approach this problem by define a read-only flag in the super class to indicate the read-only or read-write status of the VO. By default, this flag is read-write and to change the flag value from read-write to read-only is a ONE_WAY operation. We do not define any way to set the flag of the VO from read-only back to read-write.
 
regards
Philip
-----Ursprüngliche Nachricht-----
Von: Glenn Dickson [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 18. März 2003 09:02
An: [EMAIL PROTECTED]
Betreff: Value Object - mutable/immutable

Just wondering what people view are about VOs being either Mutable or non-mutable, I have heard/read that VO should be Immutable while transferring data. If the data needs to be changed then a new VO object is generated.
 
Any view pls?
Thanks
Glenn

Reply via email to