转载 2007年10月05日 13:46:00

Plain Old Java Object

POJO = "Plain Old Java Object". Term coined by MartinFowler, RebeccaParsons?, and JoshMacKenzie to denote a normal Java object that is not a JavaBean, an EntityBean, a SessionBean, etc., and does not serve any other special role or implement any special interfaces of any of the Java frameworks (EJB, JDBC, DAO, JDO, etc...). Any Java object can run within an EJB container, but many people don't know that or forget it. Fowler et al invented the acronym POJO so that such objects would have a "fancy name", thereby convincing people that they were worthy of use. POJOs are useful for creating a DomainModel. In contrast, the various types of beans and other special Java objects often have constraints that make it difficult to use them directly to model a domain.
I see a tendency of people fudging that definition of POJO because their ObjectRelationalMapping products obviously do not support POJO persistence, as they would like to announce. The typical case is referring to the JSR-220 (EJB3, JDO2) as "POJO persistence", when the EJB 3.0 early draft makes it clear that it is only a "Simplification of the enterprise bean types. Enterprise beans are simplified to more closely resemble plain Java objects ("POJOs") or JavaBeans." --KlausWuestefeld
For real POJO persistancy have a look at PersistedObjectTree unlike KlausWuestefeld's Prevayler it lets you use any type of data structure. -- Bjorn Blomqvist

EditText of this page (last edited October 3, 2007)
FindPage by searching (or browse LikePages or take a VisualTour


这几天因为公司的一个项目需要,2级联动,iOS样式滚轮,众所周知,Android端没有这样的原生控件,如图, 目前来说,这个开源控件具有的优势是, 1. 高自由度 如果需要省市,时间等这类,网...


public int getNext(int n) { /* 计算c0和c1 */ int c=n; int c0=0; int c1=0; while(((c&1)==0) && (...

LeetCode 16 3Sum Closest 找出最接近指定target的三个数的和

题目: Given an array S of n integers, find three integers in S such that the sum is closest to a gi...


相关问题: 给出一个O(n)时间的算法,在给定一个有n个不同数字的集合S以及一个正整数k≤n后,它能确定出S中最接近其中位数的k个数. 思考过程: 如果给出在线性时间内的算法,那么可能要用到最坏为线性...


思路:首先找出给定值在给定数组中的插入位置(不是真的将给定值插入给定数组),然后以此位置为基准,向左或向右依次找出最接近的k个整数。 难点:个人在处理过程中的难点在于向左或向右移动过程中的确切位置的...
  • cr2066
  • cr2066
  • 2016年08月13日 12:41
  • 871


搜狗:有N个正实数(注意是实数,大小升序排列) x1 , x2 ... xN,另有一个实数M。 需要选出若干个x,使这几个x的和与 M 最接近。 请描述实现算法,并指出算法复杂度。 思路:对于每一个...

hznu 1441 Greatest Number(选出4个数,使值最接近m)

Saya likes math, because she think math can make her cleverer. One day, Kudo invited a very simple ...
  • cacyth
  • cacyth
  • 2015年05月21日 15:09
  • 263