File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Serialization/Deserialization for Value Object Pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Serialization/Deserialization for Value Object Pattern" Watch "Serialization/Deserialization for Value Object Pattern" New topic

Serialization/Deserialization for Value Object Pattern

Pablo Pires

Joined: May 19, 2003
Posts: 7
Hi Ranchers!
I use the Value Object Pattern with flags indicating if the attribute has changed, like this:
private string attibute;
private boolean attributeHasChanged;
public void setAttribute(String attribute) {
this.attribute = attribute;
attributeHasChanged(true); // new task
public void attributeHasChanged(boolean state) {
this.attributeHasChanged = state;

The problem is that I can't just use the BeanSerialization/BeanDeserialization because inside my setAttribute I have a new operation to do (call method attributeHasChanged()).
What are the best solution for my case, or at least which ones??
Pablo Pires
Belo Horizonte - Brazil
I agree. Here's the link:
subject: Serialization/Deserialization for Value Object Pattern
It's not a secret anymore!