The built-in serialization of Java objects to their binary forms is not often seen in most projects these days, which tend to use ProtoBufs, XML, JSON, etc. for data transfer between servers. CORBA and all that seems to belong to projects of the 2000-ish era. To be honest, I have only seen it implemented once (in a J2EE project ten years ago) and it seems kind of quaint. I still get reminded of the whole Serializable
thing every time IntelliJ complains about serialVersionUID
is missing in some class, though! Nowadays, this mostly happens when I deal with JSON serialization/deserializtion using Jackson, as it has type annotations that says that some classes must implement Serializable
. Typically stuff like
StdDeserializer<T> extends JsonDeserializer<T> implements Serializable, Gettable
(I don't see that T
is required to be serializable, only the serializer?)
Now, what I do not understand is why why are still dealing with this concept of binary java object serialization when we are mostly handling JSON and XML these days. Why would Jackson (and other "new" libraries) choose to deal with this?
My only guess is that this does not concern the domain classes that are serialized by the clients of Jakcson, but that some advanced JVM usage can transfer the various objects in use between JVMs or something like that, and that would require stable interfaces for writeObject()
and readObject()
. But I am really on thin ice here.