DEV Community

loading...

Discussion on: Effective Java! Use Marker Interfaces to Define Types

nfrankel profile image
Nicolas Frankel

I'll focus on Serializable, because Set cannot be replaced by annotation. Worse, its "contract" is enforced by nothing.

Regarding Serializable, it should be the class that offers the writeObject() method. It should also be a default method, just as List.sort() is. For the whole rationale behind default methods, please check this post.