Plain Old Java Object

Plain Old Java Object

"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:

"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." [http://www.martinfowler.com/bliki/POJO.html]
The term continues the pattern of older terms for technologies that do not use fancy new features, such as POTS (Plain Old Telephone Service) in telephony, and PODS (Plain Old Data Structures) that are defined in C++ but use only C language features.

The term has most likely gained widespread acceptance because of the need for a common and easily understood term that contrasts with complicated object frameworks. A JavaBean is a POJO that is serializable, has a no-argument constructor, and allows access to properties using getter and setter methods. An Enterprise JavaBean is not a single class but an entire component model (again, EJB 3 reduces the complexity of Enterprise JavaBeans).

As designs using POJOs have become more commonly-used, systems have arisen that give POJOs some of the functionality used in frameworks and more choice about which areas of functionality are actually needed. Hibernate and Spring are examples.

The equivalent to POJO on the .NET framework is Plain Old CLR Object.

Contextual variations

As of November 2005, the term "POJO" is mainly used to denote a Java object which does not follow any of the (major) Java object models, conventions, or frameworks such as EJB.

All Java objects are POJOs, therefore ideally speaking a POJO is 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

  1. Extend prespecified classes, as inpublic class Foo extends javax.servlet.http.HttpServlet { ...
  2. Implement prespecified interfaces, as inpublic class Bar implements javax.ejb.EntityBean { ...
  3. Contain prespecified annotations, as in@javax.ejb.Entity public class Baz{ ...
However, due to technical difficulties and other reasons, many software products or frameworks described as POJO-compliant actually still require the use of prespecified annotations for features such as persistence to work properly.

POJO generation projects

; [http://www.romaframework.org Roma Meta Framework] : DDD centric framework. The innovative holistic approach lets the designer/developer to view anything as a POJO: GUI, I18N, Persistence, etc.; [http://sourceforge.net/projects/openxava OpenXava] : Framework to develop J2EE business applications rapidly and easily. It's based in business components defined with XML. Feature rich and flexible since it's used for years to create business applications. Generates POJO Hibernate EJB2 and EJB3 JPA ...; [http://sourceforge.net/projects/plainxml PlainXML] : Generating POJO by DTD; XML-POJO mapping via Java5 annotations or DTD; XML manipulations using POJO without SAX/DOM; Preprocessing of XML documents using expression language; Binary XML; RMI friendly XML; Exporting to JSON; XML marshall/unmarshall ...; [http://sourceforge.net/projects/patsystem PAT] : AOP (JBossAOP) persistence library (aspect library). Provides persistence layer with underlying Prevayler (1.02). Allows users to write their code without worrying about persistence code (POJO). Uses annotations...; [http://sourceforge.net/projects/jor Java Object Relation] : This is a Java Object Relation mapping tool that is very simple to use. It works with all major databases and requires only minimal coding effort. JOR strictly follows the POJO / POJI (Plain Old Java Objects / Plain Old Java Interfaces) model...; [http://sourceforge.net/projects/auto-persist-j AutoPersistJ] : This project aims to assist developers in developing java EE persistence layer for existing database tables. It gets metadata of selected database tables and generates classes for them. it uses and extends the ideas of DbGen project to EJB 3.0 POJO...; [http://sourceforge.net/projects/pojogen PojoGen] : It is a small tool to generate Java Code (a POJO) for an APPFUSE-based project from a DDL file, which is created from an ER diagram by Microsoft VISIO. It makes an APPFUSE-based project more easy to use.; [http://cwiki.apache.org/FELIX/ipojo.html Apache Felix iPOJO] : A new type of dynamic service-oriented component runtime that runs pure POJO applications on the top of OSGi plateforms. Non-functional ("extra-functional") services can be added and removed at runtime.; [http://labs.jboss.com/jbossmc/ JBoss Microcontainer] : The JBoss Microcontainer is a refactoring of JBoss's JMX Microkernel to support direct POJO deployment and standalone use outside the JBoss application server.; [http://www.nakedobjects.org/home/index.shtml Naked Objects] : An open source framework that auto-creates an object-oriented user interface from POJOs using the naked objects pattern.; [http://www.metawidget.org Metawidget] : A 'smart User Interface widget' that populates itself, at runtime, with UI components to match the properties of POJOs.

ee also

* Data Transfer Object


Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Plain Old Java Object — Es el acrónimo de Plain Old Java Objetct. Un POJO es una clase java normal. Este nombre se les da a las clases que no son de algún tipo especial (EJBs, Java Beans, etc) y no cumplen ningun otro rol ni implementan alguna interfaz especial …   Enciclopedia Universal

  • Plain Old Java Object — POJO est un acronyme qui signifie Plain Old Java Object que l on peut traduire en français par bon vieil objet Java. Cet acronyme est principalement utilisé pour faire référence à la simplicité d utilisation d un Objet Java en comparaison avec la …   Wikipédia en Français

  • Plain Old Java Object — Un POJO (acrónimo de Plain Old Java Object) es una sigla creada por Martin Fowler, Rebecca Parsons y Josh MacKenzie en septiembre de 2000 y utilizada por programadores Java para enfatizar el uso de clases simples y que no dependen de un framework …   Wikipedia Español

  • Plain Old Java Object — POJO ist eine Abkürzung für Plain Old Java Object, also ein „ganz normales“ Objekt in der Programmiersprache Java. Inhaltsverzeichnis 1 Motivation 2 Verwendung 3 Variationen 4 …   Deutsch Wikipedia

  • Plain Old CLR Object — POCO es un acrónimo de Plain Old CLR Object. Es un juego de palabras del POJO de la plataforma Java, y es utilizado por los desarrolladores de la plataforma .NET Framework. Un POJO (Plain Old Java Object) es una sigla creada por Martin Fowler,… …   Wikipedia Español

  • Plain Old C++ Object — Like the term plain old Java object (POJO) in the Java world, the term Plain Old C/C++ object or its acronym POCO means a C/C++ artifact that is neither defined by nor coupled to the underlying C/C++ component framework that manipulates it.… …   Wikipedia

  • Plain Old CLR Object — POCO is an acronym for Plain Old CLR Object. It is a play on the term POJO, from the Java programming world, and is used by developers targeting the Common Language Runtime of the .NET Framework. Similar to the Java context, the term is used to… …   Wikipedia

  • Plain Old Java Object — …   Википедия

  • Plain Old Data Structures — (PODS) are data structures that are represented only as passive collections of field values, without using encapsulation or other object oriented features.Plain Old Data Structures are appropriate when there is a part of a system where it should… …   Wikipedia

  • Plain Old XML — POX redirects here. For other uses, see Pox. Plain Old XML (POX) is a term used to describe basic XML, sometimes mixed in with other, blendable specifications like XML Namespaces, Dublin Core, XInclude and XLink. People typically use the term as… …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”