I talked to Michael privately... and we both agreed it would be nice to have an API to configure that.
We should definetly have a constructor with a list of immutable objects, but it would be nice also to have some sort of annotation... maybe an empty interface (implements org.jboss.jbser.UserImmutable). or any other options.
This way, if an user has a immutable object, such as.. InvoiceID, EAN... or whatever... maybe users would be able to make usage of that even under frameworks such as EJB, Seam or JBossCache.
I'm wondering what would be the simplest and more intuitive API possible here. I will make up something next week and I will post on this thread before coding it.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034306#4034306
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034306
It is possible to avoid duplication of immutable objects...
Say if in a object tree, you have the same immutable object twice, we could consider it as a single object. That would save streaming size and possibly CPU as the serialization time would be probably higher than looking up in a HashMap.
A question that I have though: Dates are not immutable... Is there any date object known to be immutable?
Michael Nascimento, the one who originally requested this issue is driving a JSR about dates.. I guess he would be able to give some ideas on this subject also.
Clebert
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4034296#4034296
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4034296