This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design 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
Have you checked out Aspose?
subject: Serialization/Deserialization for Value Object Pattern
jQuery in Action, 3rd edition