[ACCEPTED]-Why do POJO classes need to implement the Serializable interface?-java

Accepted answer
Score: 10

First this is no longer a Plain Old Java 9 Object, Because it has annotations.

But 8 staying on your premise, The Serializable 7 is required in POJOs if those are intended 6 to be used in Distributed Systems and Systems 5 which use caching and flushing into files 4 and reading back.

Mostly JPA implementations 3 do run in Distributed manner and Use caching, thus 2 this POJO is required to implement Serializable.

For 1 more information read this discussion

Score: 0

The term "POJO" was invented to seperate 12 between lightweight and heavyweight EJB 11 concepts.

POJOs do not require you to implement 10 anything.

It was used for objects that must 9 NOT implement heavyweight EJB interfaces.

The 8 term became obsolete with the introduction 7 of JEE5 and the subsequent use of lightweight 6 annotations for the definition of EJBs.

From 5 my expirience I would say that the term 4 is now toxic and should not be used anymore. Nowadays 3 it is just a common source of misunderstandings 2 and unnecessary discussions.

BTW: I believe 1 you are referring to "JavaBeans".

More Related questions