There are entities that are serialized to / from JSON using the Jackson object mapper.
Do I need to mark such classes with a Serializable interface, or is it a relic of the standard java serialization tools? Are problems otherwise possible?
There are entities that are serialized to / from JSON using the Jackson object mapper.
Do I need to mark such classes with a Serializable interface, or is it a relic of the standard java serialization tools? Are problems otherwise possible?
Serializable is used by java.io and is required if you want to save objects in a session. Some other frameworks use Serializable behind the scenes to perform serialization. If you do not know where the object is serialized using java.io.Serializable, it is better to add this interface to the DTO.
On the client side, other serialization can be used, such as JSON, XML, etc., and in this case Jackson is used, but it does not affect the processes that serialize on the server side, and it should be processed separately by your code or some other environments , such as Struts or Spring, doesn't it matter.
Source: https://ru.stackoverflow.com/questions/942481/
All Articles