What does the term Plain Old Java Object (POJO) mean? I couldn\'t find anything explanatory enough.
POJO\'s Wikipedia page says that POJO is an ordinary Jav
Plain Old Java Object :)
Well, you make it sound like those are all terrible restrictions.
In the usual context where POJO is/are used, it's more like a benefit:
It means that whatever library/API you're working with is perfectly willing to work with Java objects that haven't been doctored or manhandled in any way, i.e. you don't have to do anything special to get them to work.
For example, the XStream XML processor will (I think) happily serialize Java classes that don't implement the Serializable
interface. That's a plus! Many products that work with data objects used to force you to implement SomeProprietaryDataObject
or even extend an AbstractProprietaryDataObject
class. Many libraries will expect bean behavior, i.e. getters and setters.
Usually, whatever works with POJOs will also work with not-so-PO-JO's. So XStream will of course also serialize Serializable classes.