This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
I'm going to nitpick about what Paul said - it depends on your definition of "object equality" and "serialization".
If you're talking about the actual object instance (which is identical in the sense of "=="), then Paul is exactly right: you need to use Java object serialization, and only a Java client will be able to make sense out of it.
If you're talking about an object that is identical in the sense of the "equals" method, you can use other serialization methods (e.g. java.beans.XMLEncoder or the serialization used in Web Services) to get an object which acts the same way the original would have.
Originally posted by Ulf Dittmer: I'm going to nitpick about what Paul said - it depends on your definition of "object equality" and "serialization".
If you're talking about the actual object instance (which is identical in the sense of "=="), then Paul is exactly right: you need to use Java object serialization, and only a Java client will be able to make sense out of it.
If you're talking about an object that is identical in the sense of the "equals" method, you can use other serialization methods (e.g. java.beans.XMLEncoder or the serialization used in Web Services) to get an object which acts the same way the original would have.
I can't make any sense of this reasoning, but I strongly suspect that it is inaccurate. You can certainly use any kind of serialization to serialize and deserialize to the same instance - even standard Java serialization, which is extremely inflexible. Likewise, you can do the same for any object such that the equals method (ick) evaluates to true.
Serialization is a mechanism where a Java object can be preserved across a network. Essentially, it is an object encoded in a specific format such that it can be 'recreated' on a different machine with the same data.
Originally posted by Ulf Dittmer:
If you're talking about the actual object instance (which is identical in the sense of "=="), then Paul is exactly right: you need to use Java object serialization, and only a Java client will be able to make sense out of it.
Not true. By definition, an object is 'recreated'. This means that the new object will have a totally different memory address even if it is deserialized in the same VM. Thus, the '==' operator will always return false when comparing an object and its serialized/deserialized version and the 'equals' method will always return true.