Serializable builder should be used as proxy
Open
Component: value
P3
type=addition
- Dominant language
- Java
- Stars
- 10.6k
- Forks
- 1.2k
- Avg merge
- 6h 32m
- Merged PRs (30d)
- 13
Description
Effective Java, 2nd Ed. recommends (item 78) that proxy classes be used for serialization in many situations. It would make sense for a value class's builder to be a serialization proxy, since it ensures that validation, format conversion and defensive copying are reused. Why not generate readResolve and writeReplace methods that use the builder as a proxy whenever the builder is also Serializable?
Contributor guide
Assessment
This issue has not been assessed yet.