Interesting Facts About Plain Old Java Object (POJO): JavaBean and Origin

POJO is short for Plain Old Java Object which is an ordinary Java object, not bound by any special restriction. This term is quite suitable to describe technologies that do not use fancy new features.

Several Interesting Facts are listed as follows:

  1. An acronym for: Plain Old Java Object. The term was coined while Rebecca Parsons, Josh MacKenzie and I were preparing for a talk at a conference in September 2000. In the talk we were pointing out the many benefits of encoding business logic into regular java objects rather than using Entity Beans. We wondered why people were so against using regular objects in their systems and concluded that it was because simple objects lacked a fancy name. So we gave them one, and it’s caught on very nicely. From “MF Bliki: POJO
  2. The following are Wiki: Plain Old Java Object :
    a Java object not bound by any restriction other than those forced by the Java Language Specification; i.e. a POJO should not have to</p>
    1. Extend prespecified classes, as in <div dir="ltr">
      public class Foo extends javax.servlet.http.HttpServlet { ...

    </div>

    1. Implement prespecified interfaces, as in <div dir="ltr">
      public class Bar implements javax.ejb.EntityBean { ...

    </div>

    1. Contain prespecified annotations, as in <div dir="ltr">
      @javax.persistence.Entity public class Baz { ...

    </div>

  3. Correct Relationship between JavaBean: A JavaBean is a POJO that is serializable, has a no-argument constructor, and allows access to properties using getter and setter methods that follow a simple naming convention. So a JavaBean is a kind of POJO, it is wrong to say that POJO is a kind of JavaBean
  4. The JavaBeans specification, if fully implemented, slightly breaks the POJO model as the class must implement the Serializable interface to be a true JavaBean. Many POJO classes still called JavaBeans do not meet this requirement. Since Serializable is a marker (method-less) interface, this is not much of a burden.
Written on March 30, 2015