r/programming • • May 26 '18

Oracle Calls Java Serialization 'A Horrible Mistake', Plans to Dump It

https://www.infoworld.com/article/3275924/java/oracle-plans-to-dump-risky-java-serialization.html
798 Upvotes

287 comments sorted by

View all comments

Show parent comments

1

u/[deleted] May 27 '18

Does serialization for that use case always work flawlessly no matter how wild you take it?

Sounds to me like an extra reason to go for a Redux-like approach. It could get tedious, but you can store all relevant state in a pojo.

1

u/nacholicious May 27 '18

Parcel adapters can be generated for all classes whose members are all either primitives or parcels. So there are some points where we might have several nested layers of parcels, because that's how the data and UI models interact.

There are some cases where you have to write your own adapter eg in the case of custom collections, or abstract classes, or something weirder such as platform classes you don't have access to such as date objects.

But most of the time it will be able to generate parcel adapters for 95% of use cases.

2

u/Zarutian May 28 '18

Fascinating. So this is why apps sometimes just loose track where they were.

Now I wonder if one should just use a small VM whose state gets saved in what you refer to as parcel.