There are several risks regarding Serialization including incompatible changes. If incompatible changes occur in the classes being serialized then we can’t de-serialize it even with static final long serialVersionUID field.
So, what’s the alternatives of serialization ? XML ? If there’s any alternative then is there at all any use of serialization in real world projects ?
Sure there are alternatives to Java serialization: XML (as you’ve noted); JSON; protobuf; anything else that you’d care to use instead.
All of them will run some risk of incompatible changes. I don’t see that there’s any magic in the other methods. If you add a new attribute to an object, you’ve got to deal with “duck typing”. If you remove an attribute that’s required, all methods will have problems.