3 ms·
There's also a chapter on JDK serialized in Bloch's "Effective Java" worth a read: Item 85: Prefer alternatives to Java serialization Item 86: Implemen
by LispSporks22 3y ago
There's also a chapter on JDK serialized in Bloch's "Effective Java" worth a read:
Item 85: Prefer alternatives to Java serialization
Item 86: Implement Serializable with great caution
Item 87: Consider using a custom serialized form
Item 88: Write readObject methods defensively
Item 89: For instance control, prefer enum types to readResolve
Item 90: Consider serialization proxies instead of serialized instances
- chaokunyang 3y agoThose pattern are all supported in fury. And it seems fury are the only framework which implement the jdk `writeObject/readObject/writeReplace/readResolve/readObjectNoData` methods except jdk iteself. Other java serialization will jsut ignore those methods, and get incorect results. But today I'll suggest to avoid to use JDK `riteObject/readObject/`. Since to be compatible with JDK serialization API behaviour, it will introduce performance and space overhead. We can register custom Serializer by fury.registerSerializer(xxx.class, XXXSerializer.class). `writeReplace/readResolve` are an useful pattern, and can be used when needed.