What is POJO? I was using EJB in my project then some body suggest me to use POJO.
POJO is an acronym for Plain Old Java Object, and is favoured by advocates of the idea that the simpler the design, the better. The name is used to emphasize that the object in question is an ordinary Java Object, not a special object, and in particular not an Enterprise JavaBean (especially before EJB 3). The term was coined by Martin Fowler, Rebecca Parsons and Josh MacKenzie in September 2000.
Before EJB version 3, the EJB API was very complicated. To create an EJB you had to write multiple classes and interfaces in which you had to implement special methods, and you also had to write a complicated XML deployment descriptor for your EJB.
That complexity made EJBs not very popular. So EJBs, especially entity EJBs, got out of fashion, and simpler frameworks and libraries such as Hibernate and the Spring Framework became popular.
With these, you could forget about the complex magic needed to write EJBs; instead, you could use simple, normal Java objects (POJOs = Plain Old Java Objects).
Sun has learned from this, and in version 3, EJBs have inherited many of the features of Hibernate, which makes it much easier to write them. A v3 EJB is not much more than a simple POJO with annotations. No need to write home and remote interfaces and XML deployment descriptors, as with old-style EJBs.
Originally posted by divya sharma:
Please elaborate some more coz i could not find much about it in google.
Please use real words when posting to the forums. Abbreviations such as "coz" in place of "because" only serve to make your posts more difficult to read and less likely to generate useful responses.
Please read this for more information.
POJOs in Action
Developing Enterprise Applications with Lightweight Frameworks
Plain Old Java Object. I've seen Plain ordinary Java Object used as well.
The idea is, many frameworks complicate processes by using XML and Homes and Interfaces and stubs and skeletons and this and that and the other thing, when in reality, quite often a very simple, plain old Java object would probably do the trick just as well, be more efficient, and be easier to manage in the long run.