Is there a good reason for that? Maybe I should simply download the sources and just write “implement Serializable” next to the VCard class definition…
Ok I downloded the sources and made VCard Serializable.
Now if I don’t want to download the sources and make this small change in the code every release of smack, how do I ask the developpers if they want to make this change themselves?
I don’t see this happening. The only logical way to do this would be to make Packet itself Serializable, so that all implementations will then be Serializable as well. Of course, all implementations already represent unmarshalled XMPP stanzas, so there isn’t much of a point to doing it. Not to mention that it is potentially a large cascade effect due to the number of classes that extend Packet.
Calling toXML() will give you an XML representation of the object already.
I don’t really agree with you. It can appear logical to make VCard serializable without making all parents serializable. You will not likely ever to serialize the majority of packets, but a VCard has a few new features that make it important to serialize.
But, thank you for reminding me the toXML() method. However it seems less convenient for me to use it. Indeed, I have an Account class which stores, among other, ther login, the server, possibly the password, … and a VCard which is sent each time the user is connecting to the server or the VCard is updated while being connected. All accounts are stored in a list which, for more convenience, is serialized. It’s easy and has the advantage not to make account information too easlily accessible by lambda users.
EDIT: In fact, I wanted to allow the user to modify VCard informations while offline . But now that I’ve really thought about it, I think this is not so important to keep a copy of the VCard while offline. So the problem is resolved.